Forum Moderators: coopster

Message Too Old, No Replies

how to know the dimensions of image

         

Shanee

6:49 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



i just started work on CMS for my wallpaper site. but i am confuse how i can get the image dimensions in pixels with php. i will realy love if some one can tell me the way.

shanee

hawksbill

7:24 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



getimagesize("your filename") should return an array whose first two elements give you width and height, respectively.

distorto

7:31 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



also, the third array value holds
'width="imagewidth" height="imageheight"'
which can be pretty useful when displaying the images in img tags

Shanee

7:59 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



thanks for the help i made the below function which work cool

<?php

$size = getimagesize("pakwall001gp7.jpg");
$width = $size[0];
$height = $size;

echo "$width";
echo " X ";
echo $height;
?>

[1][edited by: Shanee at 8:02 pm (utc) on Aug. 13, 2007]