Files
java-3d/java-7_fix.patch
Tomáš Chvátal 786ad057a1 - Add patch to build correctly with new glx.h:
* java-3d-glxext.patch

- Add bsd3c to licenses as core-utils and examples are under it

- Rename files to java-3d.{changes,spec}
- Sort out few dependencies and requirements

- Added a patch (java-7_fix.patch) to fix compilation with java-7 in
  openSUSE > 12.1 (patch based on one from Debian).

- Spec file updates:
  * Updated XOrg and Mesa BuildRequires: for openSUSE > 12.1.
  * Added libXt-devel in BuildRequires: for openSUSE > 12.1 in order to fix
    compilation.

- Spec file updates:
  * Include version in jars and javadoc.

- Spec file updates:
  * Added jpackage-utils in BuildRequires: and Requires:. Added java in
    Requires:.
  * Install the jar files in %{_javadir}/java3d instead of %{_javadir}.

- Spec file updates:
  * Added ant-nodeps in BuildRequires: for openSUSE < 12.1 in order to fix
    compilation.

- Initial release (version 1.5.2).

OBS-URL: https://build.opensuse.org/package/show/Java:packages/java-3d?expand=0&rev=2
2015-05-06 09:44:51 +00:00

64 lines
2.8 KiB
Diff

Index: java3d-1.5.2/j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java
===================================================================
--- java3d-1.5.2.orig/j3d-core-utils/src/classes/share/com/sun/j3d/utils/scenegraph/io/state/javax/media/j3d/ImageComponentState.java
+++ java3d-1.5.2/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 {
Index: java3d-1.5.2/j3d-core/src/native/build.xml
===================================================================
--- java3d-1.5.2.orig/j3d-core/src/native/build.xml
+++ java3d-1.5.2/j3d-core/src/native/build.xml
@@ -347,6 +347,7 @@
<javah destdir="${javahCoreTarget}" force="yes">
<classpath>
<pathelement path="${build}/${platform}/${bldType}/classes"/>
+ <pathelement path="${vecmath_home}/build/opt/lib/ext/vecmath.jar" />
</classpath>
<class name="javax.media.j3d.Background"/>