Currently, if a POST / user uploads a photo to my PHP script, I start with code like this
getimagesize($_FILES['picture1']['tmp_name']);
Then I do LOT more material, but I also try to get the photo from the URL and process it with a different code if I can. So I want to know, I'm using something like this
$image = ImageCreateFromString(file_get_contents($url));
Can I then run getimagesize () in my $ image variable?
UPDATE
I just tried this ...
$url = 'http://a0.twimg.com/a/1262802780/images/twitter_logo_header.png';
$image = imagecreatefromstring(file_get_contents($url));
$imageinfo = getimagesize($image);
print_r($imageinfo);
But he did not work, gave it.
Warning: getimagesize(Resource id
Any idea how I can do this or something like that to get the result I get after?
source
share