Hi Chad, If the image has any licensing that is compatible with the Apache License, please add the image to a Jira ticket or a GitHub pull request if you can create a unit test. If you have a fix, that's even better ;-)
Gary On Wed, Mar 12, 2025, 12:21 Chad Groneman <cgrone...@ancestry.com.invalid> wrote: > Hi All - > > (First time on this mailing list) > > In my log files I see a lot of errors similar to what is in the > imaging-177 issue when trying to get image metadata from a jpeg. I took a > sample image that had the error to investigate, and found that the image > appears to have an embedded thumbnail (tags 0x201 and 0x202) where the > start of the thumbnail is not contiguous with the rest of the IFD entries & > data. The bytes returned by JpegImageParser.getExifRawData(...) do not > include this data, which ultimately results this exception: > > java.lang.IllegalArgumentException: Couldn't read array (start: 1396, > length: -280, data length: 1116). > at > org.apache.commons.io.build.AbstractOrigin.getByteArray(AbstractOrigin.java:521) > at > org.apache.commons.imaging.bytesource.ByteSource.getByteArray(ByteSource.java:63) > at > org.apache.commons.imaging.formats.tiff.TiffReader.getJpegRawImageData(TiffReader.java:147) > at > org.apache.commons.imaging.formats.tiff.TiffReader.readDirectory(TiffReader.java:373) > at > org.apache.commons.imaging.formats.tiff.TiffReader.readDirectory(TiffReader.java:423) > at > org.apache.commons.imaging.formats.tiff.TiffReader.readDirectories(TiffReader.java:271) > at > org.apache.commons.imaging.formats.tiff.TiffReader.read(TiffReader.java:216) > at > org.apache.commons.imaging.formats.tiff.TiffReader.readContents(TiffReader.java:223) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getMetadata(TiffImageParser.java:614) > at > org.apache.commons.imaging.formats.tiff.TiffImageParser.getMetadata(TiffImageParser.java:73) > at > org.apache.commons.imaging.AbstractImageParser.getMetadata(AbstractImageParser.java:652) > at > org.apache.commons.imaging.formats.jpeg.JpegImageParser.getExifMetadata(JpegImageParser.java:232) > at > org.apache.commons.imaging.formats.jpeg.JpegImageParser.getMetadata(JpegImageParser.java:642) > at > org.apache.commons.imaging.formats.jpeg.JpegImageParser.getMetadata(JpegImageParser.java:65) > at org.apache.commons.imaging.Imaging.getMetadata(Imaging.java:565) > at org.apache.commons.imaging.Imaging.getMetadata(Imaging.java:560) > > The image I used for this deep-dive appears to have been created by a > Samsung A32 phone. That model was released in 2021. > > Is this something that can be addressed? I don't have an account on your > Jira, but I can create one if desired so I can add the sample image. > > Thanks, > Chad >