GD Library Max File Size Limits

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
curseofthe8ball
Forum Commoner
Posts: 73
Joined: Sun Jun 01, 2003 12:33 am

GD Library Max File Size Limits

Post by curseofthe8ball »

We have an instance where a client uploaded three large photos and the GD Library scripts are returning a red x for each of them while other, smaller, photos are performing as expected.

When we attempt to view the large photos via the GD script, we get a blank page however when we add the ini_set('display_errors', True); code, we see a little more about the problem with this error:

Notice: Undefined index: action in /vservers/12345ru/htdocs/resize_imageLT.php on line 5

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 12288 bytes) in /vservers/12345ru/htdocs/resize_imageLT.php on line 93

The image sizes in questions are:

w: 3072
h: 2040
filesize: 1.6mb

The idea behind the application we are developing is that the client needs a photo gallery where they can upload photos and have the photos appear as thumbnails but when clicked would display the full photo so the user can download it in a larger version, most cases the original high-res version, to use for printing purposes.

For examples of the problem:

The large image:
http://www.thelincolntable.org/site/ima ... 2X6912.jpg

The large image via the GD Library:
http://76.12.67.113/resize_imageLT.php? ... 12&ext=jpg

Another smaller image via the GD Library that works properly:
http://www.thelincolntable.org/site/ima ... _Malta.jpg

http://76.12.67.113/resize_imageLT.php? ... ta&ext=jpg

We contacted our hosting provider to see if they would increase the memory_limits in PHP however they will not increase it from 16MB. Anyone know of any workarounds to get this to work with high-res, large file size, photos?
curseofthe8ball
Forum Commoner
Posts: 73
Joined: Sun Jun 01, 2003 12:33 am

Re: GD Library Max File Size Limits

Post by curseofthe8ball »

Anyone got any ideas? Is this even possible without raising the memory_limits setting?
curseofthe8ball
Forum Commoner
Posts: 73
Joined: Sun Jun 01, 2003 12:33 am

Re: GD Library Max File Size Limits

Post by curseofthe8ball »

Noone else has run into this problem?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: GD Library Max File Size Limits

Post by Benjamin »

You'll need to get the host to increase the memory or switch hosts.
Post Reply