GetImageSize
(PHP3, PHP4)
GetImageSize---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Get the size of a GIF, JPEG, PNG, or SWF graphic
Syntax: array getimagesize (string filename [, array imageinfo])
Description:
GetImageSize () will determine the size of any GIF, JPG, PNG, or SWF document, and returns the width and height of the document and the type of file, with a high and wide string using an internal standard HTML IMG tag.
The returned array has four elements, the index value of 0 indicates the width of the graph to how many pixels (pixels), the index value 1 indicates the height of the graph, the index value 2 indicates the type of the graph, 1=gif,2=jpg,3=png, the index value 3 is a "height=xxx width=xxx" string , it can be used directly in the IMG tag.
Example:
<?php
<?php $size = getimagesize ("img/flag.jpg");?>
<img src= "img/flag.jpg" <?php echo $size [3];?>
?>
Non-required parameters Imageinfo allows you to take some extended information out of the map, which will now return different JPG app IDs (markers) in a combined array, some programs use these app logos to embed text information into graphics, a fairly common implant IPTC http://www.xe.net/iptc/information is in the APP13 identification. You can use the Iptcparse () function to parse the binary APP13 identity and become readable.
Example:
<?php
$size = getimagesize ("testimg.jpg",& $info);
if (Isset ($info [APP13])) {
$IPTC = Iptcparse ($info ["APP13"]); Var_dump ($IPTC);
}
?>
Note: This function does not require the GD graphics function library