changeset 8613:bee8851bd076

8166988: Improve image processing performance Reviewed-by: prr
author dmarkov
date Wed, 12 Oct 2016 15:43:35 +0300
parents f85008ee39a1
children 7d4807d14247
files src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Sun Oct 09 14:45:49 2016 +0300
+++ b/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Wed Oct 12 15:43:35 2016 +0300
@@ -714,7 +714,11 @@
                     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();
@@ -738,7 +742,11 @@
                     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