Get Image width height type using PHP

Home » Blog » 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

Tags:

2 Comments on "Get Image width height type using PHP"

  1. John says:

    Excellent trick dude

    Reply →
  2. Babar says:

    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 :)

    Reply →

Got something to say? Go for it!

How to remove the http://t.co/XhUQ8T6p link from Login / Register Page: On self hosted wordpress blogs wordpress ... http://t.co/LWDOuEfq - 1 week ago