From 698c52a1eb615d409963efae884a16f6408eea16 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Thu, 6 Oct 2016 10:31:41 -0700 Subject: [PATCH] 8166988: Improve image processing performance Reviewed-by: serb, vadim, mschoene --- .../com/sun/imageio/plugins/png/PNGImageReader.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java index 79a31fd71b0..a2d7e7ecafc 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java @@ -735,7 +735,11 @@ public class PNGImageReader extends ImageReader { parse_iCCP_chunk(chunkLength); break; case iTXt_TYPE: - parse_iTXt_chunk(chunkLength); + if (ignoreMetadata) { + stream.skipBytes(chunkLength); + } else { + parse_iTXt_chunk(chunkLength); + } break; case pHYs_TYPE: parse_pHYs_chunk(); @@ -759,7 +763,11 @@ public class PNGImageReader extends ImageReader { parse_tRNS_chunk(chunkLength); break; case zTXt_TYPE: - parse_zTXt_chunk(chunkLength); + if (ignoreMetadata) { + stream.skipBytes(chunkLength); + } else { + parse_zTXt_chunk(chunkLength); + } break; default: // Read an unknown chunk