[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Avoiding com.sun.image.codec.jpeg.JPEGDecodeParam (Was: Where can I find some java classes in Debian)



[Petter Reinholdtsen]
> Is there an easy way to replace this with code that work with GNU
> Classpath?

I suspect this patch work based on documentation I found on the web, but do not know how to test it.

--- openjump-1.2D.orig/src/com/vividsolutions/jump/workbench/imagery/graphic/GraphicImage.java
+++ openjump-1.2D/src/com/vividsolutions/jump/workbench/imagery/graphic/GraphicImage.java
@@ -72,7 +72,6 @@
 import javax.media.jai.RenderedOp;
 import javax.media.jai.operator.FileLoadDescriptor;

-import com.sun.image.codec.jpeg.JPEGDecodeParam;
 import com.vividsolutions.jts.geom.Envelope;
 import com.vividsolutions.jump.feature.Feature;
 import com.vividsolutions.jump.workbench.imagery.ReferencedImage;
@@ -304,7 +303,7 @@
           image_h += (topOffset + botOffset);

           int jpg_colorspace = image.getColorModel().getColorSpace().getType();
-          if (jpg_colorspace != JPEGDecodeParam.COLOR_ID_GRAY)
+          if (jpg_colorspace != java.awt.color.ColorSpace.TYPE_GRAY)
           {
               RenderingHints rh = new RenderingHints(RenderingHints.KEY_INTERPOLATION,
+RenderingHints.VALUE_INTERPOLATION_BILINEAR);
               g.setRenderingHints(rh);

I've sent the patch upstream for comments.

Happy hacking,
-- 
Petter Reinholdtsen


Reply to: