2 messages in com.googlegroups.google-gadgets-apiRe: Image Resizing?
FromSent OnAttachments
Darren13 May 2006 17:19 
Google Employee14 May 2006 14:16 
Subject:Re: Image Resizing?
From:Google Employee (labs@google.com)
Date:05/14/2006 02:16:30 PM
List:com.googlegroups.google-gadgets-api

Hello Darren,

You can size an image in html with the following:

<img src="images/test.jpg" alt="test" name="test image" id="testimage" height="250" width="250">

where width and height specify the size in pixels.

If you want to preserve the aspect ratio of the source image (i.e. the width/height), you can specify either just the width or the height and the image will be scaled preserving the aspect ratio of the source image. This will prevent stretching of the image. For example:

<img src="images/test.jpg" alt="test" name="test image" id="testimage" width="250">

Resizing "in the browser" via height/width tags requires the full image to be downloaded and also risks creating quality problems. If you plan on having really large images (e.g. 1MB) you can preprocess the images manually with a product like Paint or PhotoShop. If you intend to download a large number of images, you might want to consider using a freeware product like ImageMagick to preprocess the images at a server.

I hope this helps.

Regards, Ralph