Re: slooooow resize

See all posts Reply

Re: slooooow resize new!
by Tim, 10 years, 1 month ago
I'm uploading one image and making several copies of it; full-size, tablet, mobile, tn, etc., and it's taking upwards of 30-40 seconds to process. I'm just using a photo directly off an iPhone (3,264 x 2,448), as most people will do these days.

Do you see anything here that will make this take so long? I'm using the exact same code for the other images, just changed their sizes. Processing just this block takes almost 9 seconds on an iMac 2013 model.
$handle->file_new_name_body     = $data['filename'];
$handle->allowed                = array('image/*');
$handle->image_resize           = true;
$handle->image_x                = 1920;
$handle->image_y                = 1280;
$handle->image_ratio_no_zoom_in = true;
$handle->file_overwrite         = true;
$handle->Process($directory);

Anything I can do to speed it up? Also, I'll be doing pixellation on some images too. Any tips on speeding that up?

Thanks!

TimReply
Re: slooooow resize new!
by colin, 10 years, 1 month ago
The code looks fine. And I am not too sure about the speed of an iMac 2013.

It is slow indeed, but not that slow since your images are very large (a lot of pixels), and you process a lot of them in a batch.

If you really want to speed up the process, I would recomend not to use this class, which rely on GD, but to use ImageMagick.Reply
Re: slooooow resize new!
by Tim, 10 years, 1 month ago
I checked out ImageMagick, and you're right: 4 seconds to do the same thing! I had no idea GD was so slow!

Sill love this class and use it every chance I get. Thanks, and keep up the great work - this class has saved my butt numerous times :)Reply