src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java

Print this page

        

*** 1254,1264 **** String name = node.getNodeName(); if (name.equals("IHDR")) { IHDR_width = getIntAttribute(node, "width"); IHDR_height = getIntAttribute(node, "height"); ! IHDR_bitDepth = getEnumeratedAttribute(node, "bitDepth", IHDR_bitDepths); IHDR_colorType = getEnumeratedAttribute(node, "colorType", IHDR_colorTypeNames); IHDR_compressionMethod = getEnumeratedAttribute(node, "compressionMethod", --- 1254,1268 ---- String name = node.getNodeName(); if (name.equals("IHDR")) { IHDR_width = getIntAttribute(node, "width"); IHDR_height = getIntAttribute(node, "height"); ! // IHDR_bitDepth is number of bits, not an index of IHDR_bitDepths ! // getEnumeratedAttribute returns valid index of IHDR_bitDepths or ! // IIOInvalidTreeException, to get real number of bits we need ! // to do "1 << index". see 8041460 ! IHDR_bitDepth = 1 << getEnumeratedAttribute(node, "bitDepth", IHDR_bitDepths); IHDR_colorType = getEnumeratedAttribute(node, "colorType", IHDR_colorTypeNames); IHDR_compressionMethod = getEnumeratedAttribute(node, "compressionMethod",