I need help about resizing images

See all posts Reply

I need help about resizing images new!
by Osman, 11 years, 4 months ago
Hello,
When I run phpinfo(), I see the upload_max_filesize and post_max_size is 20M. When I put a customized php.ini in root and change the parameteres

upload_max_filesize = 1M
post_max_size = 1M

it makes no difference. When run phpinfo() after this, I still see 20M.

What should I do to change every uploaded images that greater than 1M exactly to 1Mb? I tried changing some parameters like $handle->image_max_width, $handle->image_max_height, $handle->image_max_pixels but I could only decrease the size a little (for example 5 M file to 2 MB).

Another way I tried is that in class.upload.php I changed the line
$this->file_max_size = $val; to $this->file_max_size = 1048576;

It only uploads images that equals or smaller than 1 MB. If the image is greater than 1 MB, upload process doesn't work normally. I can use the script like this but I will always have to resize the images manually before upload.

Thank you for your help.Reply
Re: I need help about resizing images new!
by colin, 11 years, 4 months ago
The limits in php.ini depend on your system, the way PHP is set up, the permissions that you have, etc... Check with your hosting company what you can do.

If you want to resize images larger than 1MB, down to approximately 1MB, you can use this:
$foo->image_convert         = 'jpg';
$foo->jpeg_size             = 1048576;

Note that it works only with JPEG images.Reply