jela
jela

Reputation: 1469

getimagesize works for some images and not others

I have the following script that returns the height and width of the image on my local server using PHP 5.2.6, but not on my shared hosting account using 5.2.17.

ini_set('memory_limit', '32M');
list($width, $height, $type, $attr) = getimagesize("http://images.jcrew.com/erez4/erez?src=images/eiec/39/39251/39251_WO7826.tif&tmp=prdAr3");
echo "<img src=\"http://images.jcrew.com/erez4/erez?src=images/eiec/39/39251/39251_WO7826.tif&tmp=prdAr3\" $attr alt=\"getimagesize() example\" />";

I tried increasing the memory_limit as was suggested in another question. Getting the sizes of images from other sites works fine both locally and remotely, but for this site, only locally. What might be going on?

Upvotes: 2

Views: 2984

Answers (2)

Anomie
Anomie

Reputation: 94794

It sounds like your shared hosting may have allow_url_fopen disabled. If you haven't already, you should configure error logging and make sure you're not disabling error reporting in your scripts. It's probably giving you an error message to indicate why it is failing.

Upvotes: 6

Alex
Alex

Reputation: 34978

Check whether allow-url-fopen is disabled.

Upvotes: 1

Related Questions