This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes working with Image classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "working with Image classes" Watch "working with Image classes" New topic

working with Image classes

Thomas Goorden
Ranch Hand

Joined: Aug 15, 2001
Posts: 39
I was working on a class to automatically resize jpg's (for use in a servlet). It all works great in a command line program (Win2K) , but it doesn't seem to do work when I use it in a servlet and run it on a linux machine (apache; tomcat) within a servlet.

The method code:

I import : com.sun.image.codec.jpeg.*; java.awt.image.BufferedImage; java.awt.Graphics2D; java.awt.Image;
Appearantly the Imaging toolkit uses native methodes, which might be the problem. Is there a way around this? Or maybe you know a better way to tackle the resizing problem?
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
It seems that you need to include sun.awt.Motif package in your jar file or at least place it on your server.
I agree. Here's the link:
subject: working with Image classes
jQuery in Action, 3rd edition