Forum Moderators: open

Message Too Old, No Replies

Image Dimensions

Do they really matter?

         

lorax

3:07 am on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hello Folks,
I have a client who's asked me to build an Admin section for his web site that allows him to change the layout of his web site anytime he wishes. No problem I say. Then he tells me he wants to place images. He doesn't know what format or what size. Hmmm.. still no problem but warning lights are going off in my head. I can build the upload form to request the image dims and stuff them into a db cell but my question is - is it really necessary? My understanding is that image dims speed up rendering the image in the browser.

I plan to go back and read through the HTML 4 DOM but I'd like to hear any comments you care to give on this subject.

papabaer

3:26 am on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dimensions certainly do help speed rendering, after all, the browser then knows the exact size expected, instead of guessing.

Try the Graphics Forum:
[webmasterworld.com...]

I would be scared silly if a client was going to place images without any guidance... Think of a 3.4 mb 2400x1800 image being loaded into a 120x90px place holder! Yikes!

Duckula

6:27 am on Apr 19, 2002 (gmt 0)

10+ Year Member



This comes right from the back of my head, but with a good script you can retrieve the dimensions of the image once it is on the server, maybe even while it is being uploaded by reading at the header. Then you can even block an upload over certain dimensions.

That said, I don't know if such an script exists. Maybe a perl library.

jatar_k

6:32 am on Apr 19, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I used to do a site where the writers and photographers where in the field and would upload stories and images to the site that were immediately accessible. We used a perl script to store the original and create a thumbnail when they uploaded it. We got the dimensions for the original image and then made a thumb that was a certain size and stored the dimensions of the original image in a db for easier display later. It was a few years ago and I can't remember what the name of the lib we used. I will try to find it.

ggrot

6:42 am on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know php with the GD library has some good images manipulation functions including resizing i believe. papabaer, that is exactly what most clients do too, I set up one for a client which didn't check dimensions once. First image they uploaded was a full page scan from a catalog. Two scrollbars and the file was a few megs. I had a good laugh and then implemented some mechanisms to detect large images and have the server yell back at the client - never set up resizing though.

lorax

12:19 pm on Apr 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I just took a spin over to W3C and read the HTML 4.01 spec. So the reason it speeds things up is:

"The height and width attributes give user agents an idea of the size of an image or object so that they may reserve space for it and continue rendering the document while waiting for the image data."

I didn't realize. Tanx all.