Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 12th, 2005, 5:50 PM   #1
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
Getting an image's width and height

I sthere anyway that I can find an image's width and height in php? Thanx
__________________
I steal hippos...
squishiful is offline   Reply With Quote
Old Jul 12th, 2005, 6:11 PM   #2
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
$size = getimagesize("blah.jpg");
$width = $size[0];
$height = $size[1];
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2
skuinders is offline   Reply With Quote
Old Jul 12th, 2005, 6:26 PM   #3
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
thank you!
__________________
I steal hippos...
squishiful is offline   Reply With Quote
Old Jul 12th, 2005, 9:30 PM   #4
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
It gives me this error when I try:
Warning: getimagesize: Read error!
What's wrong???
Thanx
__________________
I steal hippos...
squishiful is offline   Reply With Quote
Old Jul 12th, 2005, 10:14 PM   #5
squishiful
Programmer
 
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4 squishiful is on a distinguished road
never mind
\
__________________
I steal hippos...
squishiful is offline   Reply With Quote
Old Jul 13th, 2005, 11:50 AM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
$size[3] will contain a HTMLified version: width="640" height="480" or something. You can use it as follows:
<img src="images/image.png" <?= $size[3] ?> alt="" />
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:13 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC