Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble with imagecreatefromjpeg

Status
Not open for further replies.

mufka

ISP
Dec 18, 2000
587
US
I have a script that creates thumbnails from a folder full of images. When I try to do large images (9MB) it seems to die. I've tested by putting two copies of the same image in the folder. It will always complete the first one, but on the second one it dies at imagecreatefromjpeg. I get no feedback, it just stops and exits.

Is there a way to get it to give me an error so I can see what's wrong?

 
I found that the problem was memory_limit = 128M. Why would a script take more than 128M to process a 9M file?

Anyway, I'd still like to know if there is a way to get an error output from the script for this.
 
Hi

mufka said:
Why would a script take more than 128M to process a 9M file?
Because those 9Mb are enough only to store the image data. But to work with it, the image data has to be represented completely differently in the memory. Many operations can be performed optimally only on RGB representation, which uses more memory than the indexed palette representation.

Beside that, probably not the image was the only thing in the memory, especially if your script uses some database operations too.

However 128Mb should be enough even for an office suite...

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top