Forum Moderators: not2easy

Message Too Old, No Replies

How do I find out pixel size of gifs and jpgs?

         

the_nerd

7:16 pm on Jul 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a site where people can put up their products for sale. They can enter the URL of picture as well.

Since the products are shown in tables I have to enter the exact height and width in the img - tag (so the browser can do the table layout before loading all the pictures). So far I just told the customers they have to use pictures of fixed size 75 x 100 pixels so I can use these values.

Now since more and more people use the service many complain it's too comlicated for them to adjust the pictures. Next step was to let them enter the actual size - and the software then calculates the right values so the pictures don't get distorted.

Give 'em a small finger - they want the whole hand. They just want to type in the url - and I should figure out the size.

Does anybody know how this could be done server-sided? On the server I run Windows 2000 Server.

If it's not possible (well, if a browser can find out, why not me?) - what would happen if I just specify width - would every browser know it should adjust the height accordingly?

Thanks a lot for your help.

Span

12:48 pm on Jul 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Setting the width in px and the height to "auto" should work. I'm using that myself on a page with about 30 images that are the same width but have different heights.
You have to use CSS for that though.

img {
width:75px;
height:auto;
}