changeset 12034:b59238f0e161

8166988: Improve image processing performance Reviewed-by: prr
author dmarkov
date Wed, 12 Oct 2016 15:43:35 +0300
parents 032874d46bf9
children 1c8ba7b923f2
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	Tue Oct 11 12:02:44 2016 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java	Wed Oct 12 15:43:35 2016 +0300
@@ -729,7 +729,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();
@@ -753,7 +757,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