image_resize and JPEG filesize

See all posts See thread Reply

Re: image_resize and JPEG filesize new!
by colin, 16 years, 9 months ago
It is currently not possible to avoid calculation if the uploaded image has already the dimensions that you want to resize it to.

However, the class provides some information about the image, before calling process(). Available are image_src_x, image_src_y and the newly introduced image_src_bits, image_src_pixels and image_src_type. Using these, you can process the picture differently.

For your second question, if you use $handle->image_convert = ' jpg ';, then all images will be converted to JPEG.
If you want to restrict to JPEG only, use:
$handle->allowed = array('image/jpg','image/jpeg');
Reply