RFR: 8160327: Support for thumbnails present in APP1 marker for JPEG [v2]
Brian Burkhalter
bpb at openjdk.org
Sat Feb 15 00:01:18 UTC 2025
On Fri, 14 Feb 2025 21:41:24 GMT, Phil Race <prr at openjdk.org> wrote:
>> src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java line 1653:
>>
>>> 1651: if (exifMarkerSegment != null
>>> 1652: && exifMarkerSegment.getNumThumbnails() == 1) {
>>> 1653: return 1;
>>
>> I know that my original code was also like this, but I think the eventual intent was to read both JFIF (APP0) and Exif (APP1) thumbnails if both are present. In such a case, the thumbnail count would be 2, the JFIF thumbnail would be at index 0, and the Exif thumbnail at index 1.
>>
>> In general I would expect that if both of these thumbnails were present, then they would be identical. If this were not the case, however, then preferring the Exif thumbnail would be a behavioral change. This is not necessarily a blocker for the current PR, but it might need to be addressed later.
>
> Hmm. I think it better to address it now. Who knows when we'd get back to it.
I have a patch which handles both JFIF and Exif thumbnails if this is not otherwise resolved. To revisit next week ...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22898#discussion_r1956912204
More information about the client-libs-dev
mailing list