find out an uploaded image dimensions
Moderator: General Moderators
find out an uploaded image dimensions
Once a user has uploaded a image (or while he is uploading the file) is there any way that I can find out the dimensions of the image?
-
shailendra
- Forum Newbie
- Posts: 13
- Joined: Mon Jun 20, 2005 12:20 am
- Location: INDIA
- Contact:
-
shailendra
- Forum Newbie
- Posts: 13
- Joined: Mon Jun 20, 2005 12:20 am
- Location: INDIA
- Contact:
another way to do this as,
Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 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
thanks
Code: Select all
<?php
$size = getimagesize ("img/flag.jpg");
echo "<img src=\"img/flag.jpg\" {$size[3]}>";
?>thanks