diff options
author | Julien Gouesse <[email protected]> | 2015-08-09 17:58:14 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2015-08-09 17:58:14 +0200 |
commit | b0169344a9fc01c4fcc9a9c1a750815f02bc5633 (patch) | |
tree | 570b6adb7a1b7de73677b30e50517e562381cc7e /src/jogl/classes/com | |
parent | 0608e185b3147c28d29b02af58205e639adf3f4e (diff) |
Calls ImageIOUtil in TextureIO to detect the image format of a stream, see the bug report 1042
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java index 54a552f33..80b195642 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java @@ -895,7 +895,7 @@ public class TextureIO { final boolean mipmap, final String fileSuffix) throws IOException { if (DDS.equals(fileSuffix) || - DDSImage.isDDSImage(stream)) { + DDS.equals(ImageIOUtil.getFileSuffix(stream))) { final byte[] data = IOUtil.copyStream2ByteArray(stream); final ByteBuffer buf = ByteBuffer.wrap(data); final DDSImage image = DDSImage.read(buf); @@ -1052,7 +1052,8 @@ public class TextureIO { final String fileSuffix) throws IOException { if (SGI.equals(fileSuffix) || SGI_RGB.equals(fileSuffix) || - SGIImage.isSGIImage(stream)) { + SGI.equals(ImageIOUtil.getFileSuffix(stream)) || + SGI_RGB.equals(ImageIOUtil.getFileSuffix(stream))) { final SGIImage image = SGIImage.read(stream); if (pixelFormat == 0) { pixelFormat = image.getFormat(); @@ -1124,7 +1125,8 @@ public class TextureIO { int pixelFormat, final boolean mipmap, final String fileSuffix) throws IOException { - if (PNG.equals(fileSuffix)) { + if (PNG.equals(fileSuffix) || + PNG.equals(ImageIOUtil.getFileSuffix(stream))) { final PNGPixelRect image = PNGPixelRect.read(stream, null, true /* directBuffer */, 0 /* destMinStrideInBytes */, true /* destIsGLOriented */); final GLPixelAttributes glpa = new GLPixelAttributes(glp, image.getPixelformat(), false /* pack */); if ( 0 == pixelFormat ) { @@ -1164,7 +1166,8 @@ public class TextureIO { int pixelFormat, final boolean mipmap, final String fileSuffix) throws IOException { - if (JPG.equals(fileSuffix)) { + if (JPG.equals(fileSuffix) || + JPG.equals(ImageIOUtil.getFileSuffix(stream))) { final JPEGImage image = JPEGImage.read(/*glp, */ stream); if (pixelFormat == 0) { pixelFormat = image.getGLFormat(); |