Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I read image size from other server? 1

Status
Not open for further replies.

paispatin

Technical User
Oct 21, 2003
62
A1
Dear all,

I have a server which can embedded picture from other server.

something like this :
<img src=$remote_picture>

Can I read the $remote_picture size such width and height and size from my server?

Thank you in advance.
 
Sure you can! Let's say that $remote_img is the name of the image. You need to use the getimagesize() function. The way it works is you say:

Code:
$size = getimagesize($remote_img);
$width = $size[0];
$height = $size[1];
$type = $size[2];

And there you have it. The getimagesize() function returns an array with the images size and so on. To see more, go to [a href="[URL unfurl="true"]http://us4.php.net/manual/en/function.getimagesize.php"[/URL]][/a].

Hope this helps!

Peace out,
Peace Co.
 
Peacecodotnet,

Yes, that's what I need. Thank you very much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top