I am trying to determine if image.php is valid picture file. It may be or may be not because if DB has information about resized picture it is going to be valid - image.php will resize original picture and print it to the screen. There is also alternative - there is no filename information in database and it can result error message or error picture. I'd like to get dimensions of image and if it is width = 0 and height = 0 then print error message. I was trying to do it with getimagesize but it produces error:
[function.getimagesize]: failed to open stream: No such file or directory in ...
Path is 100% correct. I've read that it is impossible to getimagesize of dynamically made picture via php. I always can check my database but i am curious if there is any hack to get image size that is dynamically created via php.
Code:
$file = "image.php?img=1";
$a = getimagesize($file);
echo 'aaaaaaaaa' . $a;
EDIT:
I did it another way because none of the solutions worked for me - i just check database for correct filename existance.
Thanks for help.
You need file_get_contents since
image.php?img=1
isn't a real file on your systemOf course you need full URL:
http://etc