Bug 665355

Summary: IIOException: Error reading PNG metadata
Product: [Fedora] Fedora Reporter: Marius Andreiana <marius.andreiana>
Component: java-1.6.0-openjdkAssignee: Deepak Bhole <dbhole>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: ahughes, dbhole, jvanek, langel, lkundrak, mjw, mmatejov, omajid, ptisnovs, srinivas_g_gowda
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: java-1.6.0-openjdk-1.6.0.0-51.1.9.5.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-02 19:34:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
source code reproducing the issue none

Description Marius Andreiana 2010-12-23 11:59:07 UTC
Created attachment 470417 [details]
source code reproducing the issue

Description of problem:
Fedora java distribution cannot read some PNG images which work fine in
* Windows java 1.6
* Linux image viewers
* browsers
* "identify a.png" works: PNG 16x16 16x16+0+0 8-bit DirectClass 1.38KB 0.000u 0:00.000

Steps to Reproduce:
 See attached.
 javac PngMain.java
 java PngMain

Actual results:
1.6.0_20
19.0-b09
Sun Microsystems Inc.
Linux
2.6.35.9-64.fc14.x86_64
DEBUG it javax.imageio.ImageIO$ImageReaderIterator@3ced0338
DEBUG reader com.sun.imageio.plugins.png.PNGImageReader@2e8f4fb3 com.sun.imageio.plugins.png.PNGImageReaderSpi@b815859
DEBUG numImages 1
Exception in thread "main" javax.imageio.IIOException: Error reading PNG metadata
	at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:761)
	at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1221)
	at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1552)
	at javax.imageio.ImageReader.read(ImageReader.java:940)
	at PngMain.main(PngMain.java:38)
Caused by: java.io.EOFException
	at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:353)
	at java.io.DataInputStream.readUTF(DataInputStream.java:609)
	at javax.imageio.stream.ImageInputStreamImpl.readUTF(ImageInputStreamImpl.java:332)
	at com.sun.imageio.plugins.png.PNGImageReader.parse_iTXt_chunk(PNGImageReader.java:469)
	at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:709)


Expected results:
Replacing a.png with b.png works

Comment 1 Pavel Tisnovsky 2011-01-03 14:28:43 UTC
The tested image contains iTXt chunk where is stored XML structure generated by Adobe Image Ready. This chunk contains following data:

Keyword:
"XML:com.adobe.xmp" (ok)

Null separator:
\0 (ok)

Text:
"<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c060 61.134777, 2010/02/12-17:32:00        "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmp:CreatorTool="Adobe Photoshop CS5 Windows" xmpMM:InstanceID="xmp.iid:1C70A6E0FE2911DF8798D62C9C3F97B1" xmpMM:DocumentID="xmp.did:1C70A6E1FE2911DF8798D62C9C3F97B1"> <xmpMM:DerivedFrom stRef:instanceID="xmp.iid:1C70A6DEFE2911DF8798D62C9C3F97B1" stRef:documentID="xmp.did:1C70A6DFFE2911DF8798D62C9C3F97B1"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="r"?>"

Please note please that the text mentioned above uses non-ASCII characters stored in XML attribute "begin" which is handled incorrectly in JDK6 (6541476 in the Oracle bug database). AFAIK Deepak is working on backporting correction from JDK7.

Comment 2 Pavel Tisnovsky 2011-01-03 16:07:42 UTC
2 Deepak: your patch really fixes this issue.

Comment 3 Prarit Bhargava 2011-01-07 15:17:47 UTC
*** Bug 665336 has been marked as a duplicate of this bug. ***

Comment 4 Fedora Update System 2011-02-01 15:38:35 UTC
java-1.6.0-openjdk-1.6.0.0-51.1.9.5.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-51.1.9.5.fc14

Comment 5 Fedora Update System 2011-02-01 15:40:43 UTC
java-1.6.0-openjdk-1.6.0.0-49.1.8.5.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-49.1.8.5.fc13

Comment 6 Fedora Update System 2011-02-01 20:52:49 UTC
java-1.6.0-openjdk-1.6.0.0-49.1.8.5.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update java-1.6.0-openjdk'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-49.1.8.5.fc13

Comment 7 Fedora Update System 2011-02-02 19:34:35 UTC
java-1.6.0-openjdk-1.6.0.0-49.1.8.5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2011-02-02 19:37:23 UTC
java-1.6.0-openjdk-1.6.0.0-51.1.9.5.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.