TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   Resizing Large Images With PHP GD (http://www.talkphp.com/advanced-php-programming/4034-resizing-large-images-php-gd.html)

ETbyrne 03-11-2009 06:18 PM

Resizing Large Images With PHP GD
 
Through working on a few websites that allow users to upload their own images I have run into a problem. The image files may upload, but if they are over 1000px tall/wide then they will not resize. PHP just stops the script and leaves the user with a blank page.

I've gotten around this issue by simply telling users not to upload photos larger than 1000px, but I was hoping there was an alternate solution. Is this a problem with GD, or do I need to change a setting in php.ini?

Tanax 03-11-2009 11:00 PM

You need to change the settings in the php.ini.
I don't know exactly which setting, but it's something that has to do with the memory.

Currently your php is taking up too much memory while resizing, causing it "overload"(or something), and that's why it's not working.

Salathe 03-11-2009 11:54 PM

memory_limit's value can be set "anywhere": http.conf, php.ini, .htaccess or at runtime with ini_set(). (The latter probably being preferable.)

There are also various techniques which can be used to best utilise memory when manipulating images, but they only go so far and there's no magic recipe.

ETbyrne 03-12-2009 04:33 PM

Thanks Tanax and Salathe! I'm gonna experiment a bit with PHP's memory usage settings and see if that fixes it.


All times are GMT. The time now is 03:49 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0