Preventing upload of large images

See all posts See thread Reply

Re: Preventing upload of large images new!
by colin, 17 years, 6 months ago
Yes, you can. It is actually in the FAQ.

After calling $foo->process(), you can read some class variables to obtain this information:
echo $foo->image_dst_x; 
echo $foo->image_dst_y;
echo $foo->file_dst_pathname;
echo $foo->file_dst_name_body;
echo $foo->file_dst_name_ext;

But, for your specific problem, you should simply have the class to resize images that are too big. Use the following settings:
$foo->image_resize = true;
$foo->image_x = 300;
$foo->image_y = 200;
$foo->image_ratio_no_zoom = true;
Using these, only the images bigger than 300x200 pixels will be resized, conserving ratio. Smaller images won't be resized as long as they fit within the dimensions.Reply