Dan Holm Posted December 1, 2009 Share Posted December 1, 2009 Hi! I have a problem when making thumbnails from larger images using the functions in GD Library. For small images this works fine but for larger, not at all. From what I understand from other threads this is due to a memory shortage in GD. Is there any way I could somehow scale down the image size or change image quality before using the GD? Any help is deeply appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/183639-gd-library-memory-issue/ Share on other sites More sharing options...
MadTechie Posted December 1, 2009 Share Posted December 1, 2009 Hi Dan, First of all I remember when I had these problems and its a bit of a rocky boat, First off I am going to assume your on a shared host, first thing you can try at the start of the script add set_time_limit (0); // turn off timeout ini_set("memory_limit", "128M"); //set memory allocation to 128Mb Now on a shared host they may block this or send you a email telling you your not allowed to do it (or words to that effect) another option maybe to run it thought Image magick (it the server supports it) ie <?php $image = new Imagick($filename); $image->thumbnailImage($size, $vsize); header("Content-type: image/png"); print $image; ?> only other option i can think of is upgrade the server/package Quote Link to comment https://forums.phpfreaks.com/topic/183639-gd-library-memory-issue/#findComment-969327 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.