Get Image width height type using PHP

This is excellent php function which can be used to get Width,Height,Type of a Image using PHP. for more information read PHP.net

list($width, $height, $type, $attr) = getimagesize("image_name.jpg");

echo "Image Properties";
echo "Width " .$width;
echo "<br/>";
echo "Height " .$height;
echo "<br/>";
echo "Type " .$type;
echo "<br/>";
echo "Attribute " .$attr;
Type of the image
1 = GIF 5 = PSD 9 = JPC 13 = SWC
2 = JPG 6 = BMP 10 = JP2 14 = IFF
3 = PNG 7 = TIFF(intel byte order) 11 = JPX 15 = WBMP
4 = SWF 8 = TIFF(motorola byte order) 12 = JB2 16 = XBM

2 Comments

  1. JohnNo Gravatar
    Jan 03, 2010

    Excellent trick dude

  2. BabarNo Gravatar
    Jun 09, 2010

    First of all its great plugin and very easy to use.
    I’m facing a problem I would like to show read more with every entry of the news.

    How can i do that ? Can you please guide me ?

    Really appreciated :)


Trackbacks and Pings

Leave a Reply