[pkg-java] r16198 - in trunk/java3d/debian: . patches

Niels Thykier nthykier at alioth.debian.org
Sat Jun 23 14:39:06 UTC 2012


Author: nthykier
Date: 2012-06-23 14:39:06 +0000 (Sat, 23 Jun 2012)
New Revision: 16198

Added:
   trunk/java3d/debian/patches/06_java-compat.patch
Modified:
   trunk/java3d/debian/changelog
   trunk/java3d/debian/patches/series
Log:
Fix FTBFS with Java7

Modified: trunk/java3d/debian/changelog
===================================================================
--- trunk/java3d/debian/changelog	2012-06-23 14:32:29 UTC (rev 16197)
+++ trunk/java3d/debian/changelog	2012-06-23 14:39:06 UTC (rev 16198)
@@ -2,6 +2,7 @@
 
   * Team upload.
   * Remove -G flag from ia64 compiler flags.  (Closes: #650799)
+  * Replace use of com.sun JPEG library with ImageIO.
 
  -- Niels Thykier <niels at thykier.net>  Sat, 23 Jun 2012 16:31:55 +0200
 

Added: trunk/java3d/debian/patches/06_java-compat.patch
===================================================================
--- trunk/java3d/debian/patches/06_java-compat.patch	                        (rev 0)
+++ trunk/java3d/debian/patches/06_java-compat.patch	2012-06-23 14:39:06 UTC (rev 16198)
@@ -0,0 +1,63 @@
+Description: FTBFS with java7
+ * Replace use of com.sun.image.codec.jpeg.* with ImageIO.
+ * Extend class-path for javah
+
+--- java3d-1.5.2+dfsg.orig/j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java
++++ java3d-1.5.2+dfsg/j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java
+@@ -61,10 +61,7 @@ import com.sun.j3d.utils.scenegraph.io.r
+ import com.sun.j3d.utils.scenegraph.io.retained.SGIORuntimeException;
+ import java.awt.color.ColorSpace;
+ import java.awt.image.DataBuffer;
+-import com.sun.image.codec.jpeg.JPEGImageEncoder;
+-import com.sun.image.codec.jpeg.JPEGImageDecoder;
+-import com.sun.image.codec.jpeg.JPEGCodec;
+-import com.sun.image.codec.jpeg.JPEGEncodeParam;
++import javax.imageio.ImageIO;
+ 
+ public abstract class ImageComponentState extends NodeComponentState {
+ 
+@@ -203,10 +200,9 @@ public abstract class ImageComponentStat
+     
+     private void writeBufferedImageJpegCompression( DataOutput out, BufferedImage image ) throws IOException {
+         ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+-        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder( byteStream );
+-
+-        encoder.encode( image );
+-        byteStream.close();
++        if (!ImageIO.write(image, "jpeg", byteStream)) {
++            throw new AssertionError("No JPEG encoder available");
++        }
+         
+         byte[] buffer = byteStream.toByteArray();
+         out.writeInt( buffer.length );
+@@ -261,11 +257,15 @@ public abstract class ImageComponentStat
+         byte[] buffer = new byte[ size ];
+         in.readFully( buffer );
+         ByteArrayInputStream byteStream = new ByteArrayInputStream( buffer );
+-        
+-        JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder( byteStream );
+-        byteStream.close();
+-        
+-        return decoder.decodeAsBufferedImage();
++        try {
++            BufferedImage img = ImageIO.read(byteStream);
++            if (img == null) {
++                throw new AssertionError("No ImageReader available.");
++            }
++            return img;
++        } finally {
++            byteStream.close();
++        }
+     }
+     
+     private void writeColorModel( DataOutput out, ColorModel colorModel ) throws IOException {
+--- java3d-1.5.2+dfsg.orig/j3d-core/src/native/build.xml
++++ java3d-1.5.2+dfsg/j3d-core/src/native/build.xml
+@@ -361,6 +361,7 @@
+     <javah destdir="${javahCoreTarget}" force="yes">
+ 	<classpath>
+ 	    <pathelement path="${build}/${platform}/${bldType}/classes"/>
++	    <pathelement path="/usr/share/java/vecmath.jar" />
+ 	</classpath>
+ 	
+ 	<class name="javax.media.j3d.Background"/>

Modified: trunk/java3d/debian/patches/series
===================================================================
--- trunk/java3d/debian/patches/series	2012-06-23 14:32:29 UTC (rev 16197)
+++ trunk/java3d/debian/patches/series	2012-06-23 14:39:06 UTC (rev 16198)
@@ -4,3 +4,4 @@
 04_no_maxmemory.patch
 05_pic_amd64.patch
 05_pic_i586.patch
+06_java-compat.patch




More information about the pkg-java-commits mailing list