I need to create thumbs from uploaded file(jpg, gif, png). I am using GD for it.
And when try to create thumb from uploaded file that is large(1262x16482) - I get fatal error Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 60126336 bytes)
on line
$image = imagecreatefromjpeg($file);
I've tried to find answers on this issues and most of them are about increasing memory_limit in php.ini. For some reasons this solutions doesn't suit me.
Maybe there are some php extensions that allow to read not all file into memory, but only some part of it.
Depending on the type of file it may be mandatory to load the whole thing into memory before doing work on it.
Most graphics file formats don't store the info in a linear format. Rather the data in one section may refer to some structure in another section or vv. Your best bet would be to either up your allowed memory in php.ini or limit the file size at upload time.
I think the use of TimThumb will be easier for you since you may be have some wrong actions http://code.google.com/p/timthumb/
All you needs to download it and call the images throw it.