0

So I am using the getimagesize function to get the size of the image. The line I use is the following:

list($width, $height) = getimagesize($imagen); 

The variable $imagen is the right one as if I echo it, I get the image url, and the image does exist. any idea?Edit: allow_url_fopen is on and the error I get is the following:

Warning: getimagesize(): Couldn't resolve host name in /home/u969736199/public_html/web/productos.php on line 43 Warning: getimagesize(http://snapi2.vv.si/web/images/productos/R2203054.jpg): failed to open stream: operation failed in /home/u969736199/public_html/web/productos.php on line 43 http://snapi2.vv.si/web/images/productos/R2203054.jpg

What I get from var_export($imagen); and var_export(is_readable($imagen)); is: http://snapi2.vv.si/web/images/productos/EE523152.jpg'http://snapi2.vv.si/web/images/productos/EE523152.jpg'false

Daniel AG
  • 183
  • 8

2 Answers2

0

If you are retrieving a remote image you need to make sure that you enable

allow_url_fopen

in php.ini.

George Mickleburgh
  • 1,181
  • 1
  • 6
  • 11
0

The url you are accessing doesn't resolve. If you go to http://snapi2.vv.si/web/images/productos/EE523152.jpg in the browser you will get a server not found page.

Jim
  • 22,354
  • 6
  • 52
  • 80