Bug 24701 - AreaAveragingScaleFilter is unimplemented
Summary: AreaAveragingScaleFilter is unimplemented
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: 0.19
: P3 normal
Target Milestone: 0.91
Assignee: Thomas Fitzsimmons
URL:
Keywords:
Depends on:
Blocks: 24023
  Show dependency treegraph
 
Reported: 2005-11-07 06:52 UTC by Robert Schuster
Modified: 2006-05-07 20:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-13 04:38:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schuster 2005-11-07 06:52:35 UTC
Although the methods of java.awt.image.AreaAveragingScaleFilter contain some instructions they do not implement the filter algorithm.
Comment 1 pere 2006-04-29 10:28:28 UTC
I suspect this is supposed to be the implementation behind the SCALE_SMOOTH
flag, and the lack of SCALE_SMOOTH support blocks openjump from running
with classpath.
Comment 2 pere 2006-04-29 12:49:33 UTC
The scaling part of the current AreaAveragingScaleFilter stub seen to be
broken.  I tested it using openjump, and got an out of range exception.
Comment 3 pere 2006-04-29 13:12:05 UTC
Here is a code fragment demonstrating the problem:

/* testImageScale.java */
import java.awt.Image;
import java.awt.image.BufferedImage;

class testImageScale {
    public static void main(String args[]) {
	System.out.println("Creating 20x20 BufferedImage"); 
	BufferedImage foo =
	    new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
	System.out.println("Creating 10x10 image using SCALE_AREA_AVERAGING");
	Image bar = foo.getScaledInstance(10, 10, Image.SCALE_AREA_AVERAGING);
	if (bar == foo) System.exit(1);
    }
}

When I run it with jamvm, I get this output:

Creating 20x20 BufferedImage
Creating 10x10 image using SCALE_AREA_AVERAGING
java.lang.ArrayIndexOutOfBoundsException: 100
   at gnu.java.awt.peer.gtk.GtkImageConsumer.setPixels(GtkImageConsumer.java:135)
   at java.awt.image.AreaAveragingScaleFilter.setPixels(AreaAveragingScaleFilter.java:126)
   at java.awt.image.BufferedImage$1.startProduction(BufferedImage.java:487)
   at java.awt.image.FilteredImageSource.startProduction(FilteredImageSource.java:112)
   at gnu.java.awt.peer.gtk.GtkImage.<init>(GtkImage.java:204)
   at gnu.java.awt.peer.gtk.GtkToolkit.createImage(GtkToolkit.java:219)
   at java.awt.Image.getScaledInstance(Image.java:204)
   at testImageScale.main(testImageScale.java:10)

(and then jamvm hangs. :( ))
Comment 4 Sven de Marothy 2006-05-03 19:41:13 UTC
Implemented.