getimagesize() error: "failed to open stream: No such file or directory"

Karthika picture Karthika · Oct 25, 2011 · Viewed 22.3k times · Source

I get the following error:

getimagesize(barbie2.jpeg) [function.getimagesize]: failed to open stream: No such file or directory

On line:

list($hight, $width) = getimagesize($name);

Answer

Rukmi Patel picture Rukmi Patel · Oct 25, 2011

in getimagesize() you need to specify path of the image. Probably it is not getting image path so it is giving you error.

your file from where you have called this function and image location is different so it is giving you error.