PHP getimagesize & embed - is image downloading twice?

Associate
Joined
17 Apr 2006
Posts
549
Location
Staffordshire
As the subject says. If the image is downloading twice from the server, is there a way to make it download once? The bandwidth use from the site is higher than I expected. Here's the code I'm using:

PHP:
list($width, $height) = getimagesize("http://www.example.com/image/" . $row['image']);

echo "<img src=\"http://www.example.com/image/" . $row['image'] . "\" width=\"" .$width ."\" height=\"" .$height ."\" />";

I'm a PHP newbie.

Cheers. :)
 
Associate
OP
Joined
17 Apr 2006
Posts
549
Location
Staffordshire
Thanks. Some of the images are stored on Amazon S3 so I think I'll add an extra field to my table for the dimensions.

I hoped getimagesize would be able to access the dimensions without downloading the file.
 
Back
Top Bottom