floridaflatlander Posted April 29, 2013 Share Posted April 29, 2013 I'm saving two photos from an upload. One is a larger photo and the other is a thumb. I was wondering if i used less resources to create the thumb copy of a photo from the reduced larger photo say 450*400 or create the thumb from the original that can be say 3mb and say 2500px * whatever or is it 6 one way or a half dozen another? imagecopyresampled($photo, $source, 0, 0, 0, 0, $photo_width, $photo_height, $width, $height);// imagecopyresampled($thumb_photo, $source, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height); // OLD WAY imagecopyresampled($thumb_photo, $photo, 0, 0, 0, 0, $thumb_width, $thumb_height, $photo_width, $photo_height); Quote Link to comment Share on other sites More sharing options...
requinix Posted April 29, 2013 Share Posted April 29, 2013 It will take much more memory to load a 2500x2500 image into memory than a 450x400. Like, >30 times more. Quote Link to comment Share on other sites More sharing options...
floridaflatlander Posted April 29, 2013 Author Share Posted April 29, 2013 Thanks for the reply requinix, I really don't know how it works but I'm assuming that the image is already loaded to make the larger 450*400 picture so it wouldn't be loading twice(I think) Quote Link to comment Share on other sites More sharing options...
requinix Posted April 29, 2013 Share Posted April 29, 2013 If you're already loading it then you can reuse it with no additional memory usage (besides what's required to make the third image). Quote Link to comment Share on other sites More sharing options...
Barand Posted April 29, 2013 Share Posted April 29, 2013 There are still 30x more pixels to process. On the other hand the quality from a larger image will probably be better than from one that has already been resized. That's the trade-off Quote Link to comment Share on other sites More sharing options...
floridaflatlander Posted April 30, 2013 Author Share Posted April 30, 2013 Thanks Barand & Requinix, this is I was looking for. I'm saving a little processing taking the thumb from the resized photo and because it's a thumb quality doesn't have to be perfect. Thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.