ImageCreateFromString and getimagesize in PHP

wbrpiyszurn

New Member
Currently if a user POST/uploads a photo to my PHP script I start out with some code like this\[code\]getimagesize($_FILES['picture1']['tmp_name']);\[/code\]I then do a LOT more stuff to it but I am trying to also be able to get a photo from a URL and process it with my other existing code if I can. SO I am wanting to know, I f I use something like this\[code\]$image = ImageCreateFromString(file_get_contents($url));\[/code\]Would I be able to then run getimagesize() on my $image variable?UPDATE I just tried this...\[code\]$url = 'http://a0.twimg.com/a/1262802780/images/twitter_logo_header.png';$image = imagecreatefromstring(file_get_contents($url));$imageinfo = getimagesize($image);print_r($imageinfo);\[/code\]But it didnt work, gave this. \[code\]Warning: getimagesize(Resource id #4) [function.getimagesize]: failed to open stream: No such file or directory in\[/code\]Any idea how I can do this or something similar to get the result I am after?
 
Back
Top