Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I determine the size of an image?

Status
Not open for further replies.

nugget

Programmer
Apr 13, 2001
11
0
0
AU
Hi,
I need to determine what size an image is. I have two types of image in the database one is 300*200 jpeg the other is 1024*200jpeg. How do i get the image size? The algorithm would look like this for example..

if image (x-axis 1024) then ...
else if image (x-axis 300) then...

Thanks for your help

Dave.

 
Try

imagesx
imagesy


Btw: Do you know or have sample source that would display an image from a string. I imported a JPEG file into a string and attempted to redisplay it, but been having trouble. Any idea? (See my recent post if you want more information)

Gary
gwinn7
 
$thesize = getimagesize("yourPicture")

print $thesize[0] // width
print $thesize[1] // height

Olli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top