Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/183639-gd-library-memory-issue/
Share on other sites

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.