2002/07/21 01:00:39
[org.ibex.core.git] / src / org / xwt / PNG.java
index 1c06968..03b05f9 100644 (file)
@@ -159,7 +159,11 @@ public class PNG implements ImageDecoder {
     /** handle transparency chunk; modifies palette */
     private void handletRNS() throws IOException {
         int chunkLen = chunkLength;
-               if (palette == null) throw new IOException("tRNS chunk encountered before pLTE");
+        if (palette == null) {
+            if (Log.on) Log.log(this, "warning: tRNS chunk encountered before pLTE; ignoring alpha channel");
+            inputStream.skip(chunkLength);
+            return;
+        }
                int len = palette.length;
         if (colorType == 3) {
             transparency = true;