On 29 Mar 2004 23:55:36 -0800,
jf*********@netcourrier.com (jfsebastian) wrote:
I am wondering if getImageSize does fetch images
*before* extracting the size infos (like perl
modules...) or if the function only fetch the
few bytes in the file headers which contains
the size information ?
I am trying to code a similar function in perl,
and i think it is very stupid to have to fetch
a 2Mo image to just retrieve its size...
From a quick glance at the source code, it looks like it should be bailing out
once it's got all the header, and shouldn't have to fetch the whole image.
But:
<pre>
<?php
$x = getimagesize('http://localhost/~andyh/j5_360.jpg');
var_dump($x);
?>
</pre>
Output:
array(7) {
[0]=>
int(6894)
[1]=>
int(963)
[2]=>
int(2)
[3]=>
string(25) "width="6894" height="963""
["bits"]=>
int(8)
["channels"]=>
int(3)
["mime"]=>
string(10) "image/jpeg"
}
(i.e. it's a pretty big image)
Apache log shows:
127.0.0.1 - - [30/Mar/2004:23:13:53 +0100] "GET /~andyh/j5_360.jpg HTTP/1.0"
200 2833418 "-" "-"
Which seems to say it's fetched all 2.8M of it :-(
Apache's server-info page agrees, from the increase in Total Traffic.
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk /
http://www.andyhsoftware.co.uk/space