How to get height, width and type of an image in PHP ?

by   SJRANJAN

getimagesize() function in PHP used to find height, width and type of an given image.
phplogo

Code

Output

Width: 150
Height: 140
Type: 3
Image type displayed in the output can be matched with the following reference to get the actual image type.
1 = GIF
2 = JPG
3 = PNG
4 = SWF
5 = PSD
6 = BMP
7 = TIFF(intel byte order)
8 = TIFF(motorola byte order)
9 = JPC
10 = JP2
11 = JPX
12 = JB2
13 = SWC
14 = IFF
15 = WBMP
16 = XBM
Share on :