mago
02-22-2008, 01:42 PM
When using ImageCreateFromJPEG (e.g. if I want to resize an image) an uncompressed version of the image is stored in the memory. As a consequence, a 100 kb image (dimensions 5000x5000) may consume the entire memory_limit and therefore be rejected (Fatal error: Allowed memory size of xxxxxxxx bytes exhausted...), while a 900 kb image (1000x1000) may upload without any problems.
The easy solution would be to increase memory_limit etc. in php.ini, but if we are looking at really large dimensions this is not always a good solution. It would consume a lot of memory and could eventually slow down the server.
My questions are therefore:
Are there any alternatives to ImageCreateFromJPEG()?
Are there any libraries or plug-ins that I can install, which are using compressed images instead of uncompressed images?
Thank you and best regards,
The easy solution would be to increase memory_limit etc. in php.ini, but if we are looking at really large dimensions this is not always a good solution. It would consume a lot of memory and could eventually slow down the server.
My questions are therefore:
Are there any alternatives to ImageCreateFromJPEG()?
Are there any libraries or plug-ins that I can install, which are using compressed images instead of uncompressed images?
Thank you and best regards,