Found bug in PSDParser.java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Found bug in PSDParser.java

Andrew Stepanov
Hi.

When i parse my PSD file, i got expection:

org.apache.tika.exception.TikaException: Invalid Image Resource Block
Signature Found, got 3686985 0x384249 but the spec defines 943868237

I compared specification (
http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm)
with the source code and found the error.

*From specification:*

Image Resource Block - The resource data, described in the sections on the
individual resource types. It is padded to make the size *EVEN*.

*From source code:*

          int dataLen = EndianUtils.readIntBE(stream);
          totalLength = 4 + 2 + nameLen + 4 + dataLen;

          data = new byte[dataLen];
          IOUtils.readFully(stream, data);

*Problem: Size should be even*
Reply | Threaded
Open this post in threaded view
|

Re: Found bug in PSDParser.java

Nick Burch-2
On Thu, 11 Oct 2012, Andrew Stepanov wrote:
> org.apache.tika.exception.TikaException: Invalid Image Resource Block
> Signature Found, got 3686985 0x384249 but the spec defines 943868237
>
> I compared specification (
> http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm)
> with the source code and found the error.

Are you able to create a patch that fixes it? If so, please upload that to
JIRA, ideally with a small file that shows the problem and a unit test

Thanks!

Nick