Image resize failes (execution time)

See all posts Reply

Image resize failes (execution time) new!
by Gunther, 12 years, 9 months ago
Hello, first greate file upload class.
Got this issue, when uploading large images, i want to resize them to surtin sizi before saveing them. But i am getting this error every time image needs to be resized: atal error: Maximum execution time of 30 seconds exceeded in upload_class.php on line 4270

In the code on line 4270: $rgba = imagecolorat($image_dst, $x, $y);

Images that dont need to be resized upload okay.
Here is the function call:
if($handle->file_is_image && $handle->image_src_x>2000){
  // resize image to 2000px width
  $handle->image_resize            = true;
  $handle->image_ratio_y           = true;
  $handle->image_x                 = 2000;
}
Reply
Re: Image resize failes (execution time) new!
by colin, 12 years, 9 months ago
Your server requires more time to process large images. Increase the max_execution_time variable in your php.iniReply
Re: Image resize failes (execution time) new!
by Panoramix, 12 years, 8 months ago
I have the same problem. The max execution time of 30 seconds is reached on large images.

My request though, I rather not increases the max_execution_time. Isn't there a more efficient way to resize images with the GD library? I'm not quite sure what is going on in the x, y loop in the upload class. You copying pixel per pixel? Is there a way to use the GD library for resizing and converting within the class?Reply
Re: Image resize failes (execution time) new!
by colin, 12 years, 8 months ago
THe class is using as mush GD as possible, but a lot of processing has to be done on top of GD.

I plan a future rewrite of the class where ImageMagick could be used in place of GD, which will be more efficient.Reply