RFR: 8160327: Support for thumbnails present in APP1 marker for JPEG [v2]

Brian Burkhalter bpb at openjdk.org
Fri Feb 14 17:37:14 UTC 2025


On Thu, 13 Feb 2025 20:50:07 GMT, Phil Race <prr at openjdk.org> wrote:

>> Jeremy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8160327: fixing typo so `thumbnailPos` can be zero
>>   
>>   The `thumbnailLength` cannot be zero, but the position can be.
>
> src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/ExifMarkerSegment.java line 165:
> 
>> 163:                 ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN);
>> 164:         if (input.readUnsignedShort() != TIFF_MAGIC) {
>> 165:             throw new IllegalArgumentException("Bad magic number");
> 
> Where does this exception end up ? I would have supposed that if there's an Exif segment we don't like it would be best to just act like the segment isn't there.

I concur.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22898#discussion_r1956505245


More information about the client-libs-dev mailing list