From 2689c311cd0fea40740c7d9db68a4e40020b1281 Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Sun, 9 Aug 2015 17:59:43 +0200 Subject: Deprecates SGIImage.isSGIImage() and DDSImage.isDDSImage(), see the bug report 1042 --- .../com/jogamp/opengl/util/texture/spi/DDSImage.java | 4 +++- .../com/jogamp/opengl/util/texture/spi/SGIImage.java | 17 +++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java index a71458837..36c44a409 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java @@ -51,10 +51,10 @@ import java.nio.ByteOrder; import java.nio.channels.FileChannel; import com.jogamp.opengl.GL; - import com.jogamp.common.nio.Buffers; import com.jogamp.common.util.IOUtil; import com.jogamp.opengl.util.GLBuffers; +import com.jogamp.opengl.util.texture.ImageIOUtil; /** A reader and writer for DirectDraw Surface (.dds) files, which are used to describe textures. These files can contain multiple mipmap @@ -246,7 +246,9 @@ public class DDSImage { @param in Stream to check @return true if input stream is DDS image or false otherwise @throws java.io.IOException if an I/O exception occurred + @deprecated rather call {@link ImageIOUtil#getFileSuffix(InputStream)} */ + @Deprecated public static boolean isDDSImage(InputStream in) throws IOException { if (!(in instanceof BufferedInputStream)) { in = new BufferedInputStream(in); diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java index 9088dc48e..ff8167bb0 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java @@ -40,8 +40,9 @@ package com.jogamp.opengl.util.texture.spi; import java.io.*; -import com.jogamp.opengl.*; +import com.jogamp.opengl.*; +import com.jogamp.opengl.util.texture.ImageIOUtil; import com.jogamp.common.util.IOUtil; /**

Reads and writes SGI RGB/RGBA images.

@@ -190,11 +191,15 @@ public class SGIImage { return image; } - /** Determines from the magic number whether the given InputStream - points to an SGI RGB image. The given InputStream must return - true from markSupported() and support a minimum of two bytes - of read-ahead. */ - public static boolean isSGIImage(InputStream in) throws IOException { + /** + * Determines from the magic number whether the given InputStream points to + * an SGI RGB image. The given InputStream must return true from + * markSupported() and support a minimum of two bytes of read-ahead. + * + * @deprecated rather call {@link ImageIOUtil#getFileSuffix(InputStream)} + */ + @Deprecated + public static boolean isSGIImage(InputStream in) throws IOException { if (!(in instanceof BufferedInputStream)) { in = new BufferedInputStream(in); } -- cgit v1.2.3