Package list java3d / b68d90a
Fix FTBFS with Java7 Niels Thykier 9 years ago
3 changed file(s) with 65 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
11
22 * Team upload.
33 * Remove -G flag from ia64 compiler flags. (Closes: #650799)
4 * Replace use of com.sun JPEG library with ImageIO.
45
56 -- Niels Thykier <niels@thykier.net> Sat, 23 Jun 2012 16:31:55 +0200
67
0 Description: FTBFS with java7
1 * Replace use of com.sun.image.codec.jpeg.* with ImageIO.
2 * Extend class-path for javah
3
4 --- java3d-1.5.2+dfsg.orig/j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java
5 +++ java3d-1.5.2+dfsg/j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java
6 @@ -61,10 +61,7 @@ import com.sun.j3d.utils.scenegraph.io.r
7 import com.sun.j3d.utils.scenegraph.io.retained.SGIORuntimeException;
8 import java.awt.color.ColorSpace;
9 import java.awt.image.DataBuffer;
10 -import com.sun.image.codec.jpeg.JPEGImageEncoder;
11 -import com.sun.image.codec.jpeg.JPEGImageDecoder;
12 -import com.sun.image.codec.jpeg.JPEGCodec;
13 -import com.sun.image.codec.jpeg.JPEGEncodeParam;
14 +import javax.imageio.ImageIO;
15
16 public abstract class ImageComponentState extends NodeComponentState {
17
18 @@ -203,10 +200,9 @@ public abstract class ImageComponentStat
19
20 private void writeBufferedImageJpegCompression( DataOutput out, BufferedImage image ) throws IOException {
21 ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
22 - JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder( byteStream );
23 -
24 - encoder.encode( image );
25 - byteStream.close();
26 + if (!ImageIO.write(image, "jpeg", byteStream)) {
27 + throw new AssertionError("No JPEG encoder available");
28 + }
29
30 byte[] buffer = byteStream.toByteArray();
31 out.writeInt( buffer.length );
32 @@ -261,11 +257,15 @@ public abstract class ImageComponentStat
33 byte[] buffer = new byte[ size ];
34 in.readFully( buffer );
35 ByteArrayInputStream byteStream = new ByteArrayInputStream( buffer );
36 -
37 - JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder( byteStream );
38 - byteStream.close();
39 -
40 - return decoder.decodeAsBufferedImage();
41 + try {
42 + BufferedImage img = ImageIO.read(byteStream);
43 + if (img == null) {
44 + throw new AssertionError("No ImageReader available.");
45 + }
46 + return img;
47 + } finally {
48 + byteStream.close();
49 + }
50 }
51
52 private void writeColorModel( DataOutput out, ColorModel colorModel ) throws IOException {
53 --- java3d-1.5.2+dfsg.orig/j3d-core/src/native/build.xml
54 +++ java3d-1.5.2+dfsg/j3d-core/src/native/build.xml
55 @@ -361,6 +361,7 @@
56 <javah destdir="${javahCoreTarget}" force="yes">
57 <classpath>
58 <pathelement path="${build}/${platform}/${bldType}/classes"/>
59 + <pathelement path="/usr/share/java/vecmath.jar" />
60 </classpath>
61
62 <class name="javax.media.j3d.Background"/>
33 04_no_maxmemory.patch
44 05_pic_amd64.patch
55 05_pic_i586.patch
6 06_java-compat.patch