Correctly sizing picture

J

Jonathan Blitz

I have created a File Upload page.

When the user selects the picture from the computer I display on the page.

My problem is that pictures are of differant sizes and ratios.
I don't want to show the picture full size as it can be quite big - I need
to show a smaller version.

I tried to fix the size in the picture definition but then I lose the aspect
ratio.
What can I do?

--
Jonathan Blitz
AnyKey Limited
Israel

Tel: (972) 8 9790365

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
K

Kevin Spencer

What you want to do can't be achieved correctly without some server-side
programming. Yes, you can change the width and/or height attributes of an
image in a web page, but that doesn't change the size (in bytes) of the
actual image, nor does it affect the time it takes for the browser to
download it, which is based upon the size (in bytes) of the image file.

To do it with attributes (in case you don't want to or can't do server-side
programming), you set only ONE of the 2, height OR width attribute, and the
other will size proportionately.

To do it on the server requires ASP, ASP.Net, or some other server-side
programming technology, and a good bit of experience.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top