Is their a way to resize an image before storing it in the database without using a tmp file?
Look into ImageMagick