Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Java (http://www.linux-archive.org/debian-java/)
-   -   Avoiding com.sun.image.codec.jpeg.JPEGDecodeParam (Was: Where can I find some java classes in Debian) (http://www.linux-archive.org/debian-java/61917-avoiding-com-sun-image-codec-jpeg-jpegdecodeparam-where-can-i-find-some-java-classes-debian.html)

Petter Reinholdtsen 03-30-2008 01:03 PM

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.Referenc edImage;
@@ -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


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


All times are GMT. The time now is 05:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.