[thelist] restrict image size?

Jason Morehead jmorehead at alphalincoln.com
Fri Jan 26 11:14:31 CST 2001


>Howdy,
>I use SAFileup to allow visitors to my auction site to upload 
>images.  Using that component I am able to restrict the size in 
>bytes, however not the size in pixels.  I am wondering if there is a 
>way to restrict the size of an image that might be too large for a 
>page layout.  e.g.,
>
>http://www.campaigncollectibles.com/item_detail.asp?ItemID=630
>
>(watch for url wrap).  Notice how the width of that image pushes my 
>fixed width table out?
>
>Is there any way to code this logic:  if image width > than 400 set 
>image width to 75% or some such thing?

one thing you could do is simply resize the image on the page that 
displays it.  in other words, on your "item_detail.asp" page, include 
height and width attributes in the image tag that resizes the images 
that people upload to your site.  i'll admit it's not perfect, but 
it's something i've had to implement on some of our sites where 
people can upload photos.

note... this doesn't affect file size, just display size.  a 100kb 
file that is 800px wide, but displayed at 400px wide is still 100kb.

jason
-- 
http://www.alphalincoln.com/
alphagraphics of nebraska - web services
201 n 14th - lincoln, ne 68508 - 402.475.0000




More information about the thelist mailing list