С http://viralpatel.net/blogs/2009/05/20-useful-java-code-snippets-for-java-developers.html:
private void createThumbnail(String filename, int thumbWidth, int thumbHeight, int quality, String outFilename)
02 throws InterruptedException, FileNotFoundException, IOException
03 {
04 // load image from filename
05 Image image = Toolkit.getDefaultToolkit().getImage(filename);
06 MediaTracker mediaTracker = new MediaTracker(new Container());
07 mediaTracker.addImage(image, 0);
08 mediaTracker.waitForID(0);
09 // use this to test for errors at this point: System.out.println(mediaTracker.isErrorAny());
10
11 // determine thumbnail size from WIDTH and HEIGHT
12 double thumbRatio = (double)thumbWidth / (double)thumbHeight;
13 int imageWidth = image.getWidth(null);
14 int imageHeight = image.getHeight(null);
15 double imageRatio = (double)imageWidth / (double)imageHeight;
16 if (thumbRatio < imageRatio) {
17 thumbHeight = (int)(thumbWidth / imageRatio);
18 } else {
19 thumbWidth = (int)(thumbHeight * imageRatio);
20 }
21
22 // draw original image to thumbnail image object and
23 // scale it to the new size on-the-fly
24 BufferedImage thumbImage = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB);
25 Graphics2D graphics2D = thumbImage.createGraphics();
26 graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
27 graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
28
29 // save thumbnail image to outFilename
30 BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(outFilename));
31 JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
32 JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(thumbImage);
33 quality = Math.max(0, Math.min(quality, 100));
34 param.setQuality((float)quality / 100.0f, false);
35 encoder.setJPEGEncodeParam(param);
36 encoder.encode(thumbImage);
37 out.close();
38 }
Вам необходимо выяснить, откуда берутся все классы, но не похоже, что они используют что-то, что не связано с JDK (хотя яможет быть не так).