diff --git a/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java b/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java index 647a4f10..44281235 100644 --- a/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java +++ b/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java @@ -392,6 +392,9 @@ public final class PICTImageReader extends ImageReaderBase { } opCode = pStream.readUnsignedShort(); } + if (DEBUG) { + System.out.printf("opCode 0x%04x at pos %08x:\n", opCode, pStream.getStreamPosition() - 2); + } // See what we got and react in consequence switch (opCode) { @@ -1876,11 +1879,6 @@ public final class PICTImageReader extends ImageReaderBase { srcRect.setLocation(0, 0); // Raster always start at 0,0 context.copyBits(img, srcRect, dstRect, transferMode, region); } - - // Line break at the end - if (DEBUG) { - System.out.println(); - } } /** @@ -2074,9 +2072,15 @@ public final class PICTImageReader extends ImageReaderBase { } if (DEBUG) { - System.out.print("Line " + scanline + ", byteCount: " + packedBytesCount); - System.out.print(" dstBytes: " + dstBytes.length); - System.out.println(); + if (scanline < 5 || scanline >= srcRect.height - 5) { + System.out.print("Line " + scanline + ", byteCount: " + packedBytesCount); + System.out.print(" dstBytes: " + dstBytes.length); + System.out.println(); + } + else if (scanline == 5) { + // Truncate any remaining scanlines... + System.out.println("..."); + } } // Unpack them all @@ -2189,11 +2193,6 @@ public final class PICTImageReader extends ImageReaderBase { srcRect.setLocation(0, 0); // Raster always starts at 0,0 context.copyBits(img, srcRect, dstRect, transferMode, region); } - - // Line break at the end - if (DEBUG) { - System.out.println(); - } } /* @@ -2558,7 +2557,6 @@ public final class PICTImageReader extends ImageReaderBase { // for (int i = 1; pPolygon != null && i < pPolygon.npoints; i++) { // System.out.print(", (" + pPolygon.xpoints[i] + "," + pPolygon.ypoints[i] + ")"); // } - System.out.println(); } @Override @@ -2653,6 +2651,7 @@ public final class PICTImageReader extends ImageReaderBase { try { ImageInputStream input = ImageIO.createImageInputStream(file); String title = file.getName(); + System.out.println("Processing " + file); System.out.println("canRead: " + reader.getOriginatingProvider().canDecodeInput(input)); @@ -2668,9 +2667,11 @@ public final class PICTImageReader extends ImageReaderBase { showIt(image, title); System.out.println("image = " + image); + System.out.println(); } catch (IOException e) { System.err.println("Could not read " + file.getAbsolutePath() + ": " + e); + e.printStackTrace(); } } }