CodeIgniter Forums
Image Manipulation Class & max image size - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Image Manipulation Class & max image size (/showthread.php?tid=18808)

Pages: 1 2


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]hendrik[/eluser]
Is there a maximum filesize or dimension (width/height) that the image manipulation class cannot deal with?

My resize function works fine until it hits images wider than 4000px. (Haven't determine exactly when it stops working, the images might be even smaller.)


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]Dam1an[/eluser]
Not sure if there's a limit on width/height, but it could just the be file size limit?
Try a 1x4000 and 4000x1 images, see if they work


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]jedd[/eluser]
My money would be on Apache/PHP memory limits - try bumping that up to something substantially larger, and consult the forums again if pain persists.


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]hendrik[/eluser]
I've uploaded a jpg (1px X 4000px) & (100px X 4000px). Worked fine.

Got the issue with jpg 1000px X 4000px, filesize 48kb. I made sure it's 72dpi.


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]rogierb[/eluser]
Increase the memory limit apache/php is allowed to use. It's a well known problem when dealing with jpg since jpg is a compressed format and to manipulate an image it has to be decompressed.


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]Dam1an[/eluser]
[quote author="rogierb" date="1242760920"]Increase the memory limit apache/php is allowed to use. It's a well known problem when dealing with jpg since jpg is a compressed format and to manipulate an image it has to be decompressed.[/quote]

That makes sense... I was puzzled for a minute wondering how a 48Kb image can be a memory problem lol


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]hendrik[/eluser]
Also tried gif(4kb) & png(20kb) at those sizes. Didn't work. Memory_limit=8M

Do you think that maybe 1000x4000=4000000 pixels are too much for GD2 to handle?


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]Dam1an[/eluser]
I just realised, you never told us what error you get when you say it stops working...
Apparently, there's a pixel limit variable you can change in the GD2 config file (no idea where that is though)


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]hendrik[/eluser]
[quote author="Dam1an" date="1242764727"]I just realised, you never told us what error you get when you say it stops working...
Apparently, there's a pixel limit variable you can change in the GD2 config file (no idea where that is though)[/quote]

Although I var_dump($this->image_lib->display_errors()Wink; I don't get any. Just a blank page with no html. It's as if I've got a syntax issue or the script simply bombs out.

With the smaller images it gets redirected to page with listing of images once resize is complete. (so I've ruled out syntax)


Image Manipulation Class & max image size - El Forum - 05-19-2009

[eluser]Dam1an[/eluser]
Have you tried increasing the PHP timeout (I'm not sure if you get an error when it times out or a blank screen, but its worth trying)