Chat on IRC |
Petty Webpage Woes
Posted by eternaldisciple [send private reply] at July 23, 2001, 05:58:59 PM
Is there a way to scale image sizes on webpages, perhaps with
Javascript or another scripting language? I need it to scale the images based on screen resolution. I'm trying to avoid hard-coding the image sizes. I know there's a javascript that detects monitor resolution, and I thought maybe I could use document.write.* or something, but I wasn't sure exactly how. I was just hoping to make the images more dynamic. Maybe CCS would work somehow?
Posted by Psion [send private reply] at July 23, 2001, 07:21:06 PM
I think it would be best for you to simply show images from different URL's based on resolution. Scaling one image for all sizes will no doubt result in bad quality for some sizes.
Posted by AngelOD [send private reply] at July 23, 2001, 08:46:53 PM
Indeed.. Or maybe use PHP, that has functions to help you handle things like this.. Ofcourse, if it means that you'll have to learn a new language, and you don't want to (or the server doesn't support it), then just follow Psion's advice. :o)
Posted by Psion [send private reply] at July 24, 2001, 06:10:01 AM
If only a small number of resolutions are supported and you don't have amazingly tight limits on server hard drive space, then my solution is better no matter what facilities PHP has.
Posted by taubz [send private reply] at July 25, 2001, 06:25:13 PM
WIDTH=50% ??
If your image is suitable for high resolution, it might look decent on lower resolutions. - taubz
Posted by gian [send private reply] at July 26, 2001, 12:19:17 AM
Yeah, that was what I was thinking...
Psion: In PHP you could scale the image just as well as you could in say... Photoshop (www.boycottadobe.com) :-)
Posted by Cobbs [send private reply] at July 26, 2001, 03:49:54 PM
If you do it before hand you could save processing power in the long run :) and you could use the gimp,
Windows Version http://user.sgic.fi/~tml/gimp/win32/downloads.html Linux and other versions, http://www.gimp.org
Posted by AngelOD [send private reply] at July 26, 2001, 07:21:53 PM
Indeed.. My suggestion was made, based on the fact that I just made that for a company website, where a picture can be uploaded via a webbased interface, and a thumbnail will be created from the uploaded picture. But this is only useful if pictures are uploaded like that, and not as an actual part of the page.. I guess. :o)
Register as a new user | ||||||||||