![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
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... |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4
![]() |
$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 |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
thank you!
__________________
I steal hippos... |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
It gives me this error when I try:
Warning: getimagesize: Read error! What's wrong??? Thanx
__________________
I steal hippos... |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Jun 2005
Location: Amittyville
Posts: 60
Rep Power: 4
![]() |
never mind
\
__________________
I steal hippos... |
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
$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="" /> |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|