views:

132

answers:

1

I am using PHPs GD extension for jpg image manipulation. The problem is that at one point I am using the getimagesize function to get image width and height. It works fine locally as well as one one of my remote servers but not on another of my remote servers. The problem seems to arise when using getimagesize for relatively large images(approx. 640 KB and greater) but not for smaller images. Has anyone come across a problem like this? Please help.

+2  A: 

I'm pretty sure you need to increase PHP's memory limit, try doubling it initially to see if that fixes it. You can do so in your .htaccess (if you're using apache):

php_value memory_limit 16M

You can also set this in your scripts:

ini_set('memory_limit', '16M');

Add this line into your script to see what error GD is giving you:

error_reporting(E_ALL);
karim79