tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pete Freitag">
Subject RE: image resize
Date Tue, 31 Jul 2001 16:18:33 GMT
Resizing with the IMG tag does work for slight scaling. In the case where
you are generating thumbnails, you would still be downloading the full sized
image, and would defeat the purpose of having thumbnails.

I've been working on a server side solution for this also, but have run into
a couple of problems, the main problem is the reading an image in from a
file.  I've been using:

Image img = Toolkit.getDefaultToolkit().createImage("img.jpg");
Image img = Toolkit.getDefaultToolkit().getImage("img.jpg");

but it hangs.

I've narrowed it down to Toolkit.getDefaultToolkit() hanging, and I haven't
been able to find another way to do it. It works fine, but I can't get it to
terminate without killing the JVM, or calling a System.exit(0); I'm running
Windows 2000 with JDK 1.3

Pete Freitag (
WEB Developers Resources

-----Original Message-----
From: William Kaufman []
Sent: Tuesday, July 31, 2001 11:50 AM
To: ''
Subject: RE: image resize

There's also the possibility of letting the browser resize it for you, by
setting the width and height attributes of the <IMG> tag.  Browsers don't
scale images well, but it's a whole lot easier than doing it yourself.

(Also note that AWT can't run on Unix without an X server, nor can it run if
the server is locked.  Look through the Tomcat archives for more

                                        -- Bill K.

> -----Original Message-----
> From: Cory Powers []
> Sent: Tuesday, July 31, 2001 8:21 AM
> To: ''
> Subject: RE: image resize
> I'm not sure, but there is good info on working with images
> on the jguru
> site. Try
> -----Original Message-----
> From: Reynir Hübner []
> Sent: Tuesday, July 31, 2001 11:13 AM
> To:
> Subject: image resize
> Hi,
> this is probably a bit of topic...
> What would be the best way to resize images with servlet ?
> I have .jpgs and .gifs in files (not kept in database) and I need to
> create new files in different sizes from those images.
> Is anyone willing to give me a hint (or more :) on how to do it.
> thanx
> -r

View raw message