[OpenJDK 2D-Dev] [9] RFR JDK-8160327: Support for thumbnails present in APP1 marker for JPEG

Philip Race philip.race at oracle.com
Wed Aug 31 23:03:37 UTC 2016


imageCreationTime = LocalDateTime.parse(dateTime, formatter);

Seems like it may throw DateTimeParseException - a subtype of 
RuntimeException
https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#parse-java.lang.CharSequence-java.time.format.DateTimeFormatter-

I think in the case of such malformed data we want to silently swallow it
rather than propagate to the caller.

  164                 // XXX Might want to set 
JPEGImageReader$ThumbnailReadListener
  165                 // to track thumbnail reading progress.

XXX ?

int getThumbnailWidth(int index) {
  187         if (getNumThumbnails() != 1 || index != 0) {
  188             throw new IndexOutOfBoundsException();
  189         }
  190         return thumbnailWidth;
  191     }

Would it not be more informative to include "index" in the exception ?

Other than that looks fine.

-phil.

On 8/29/16, 7:39 AM, Brian Burkhalter wrote:
> Please review at your convenience.
>
> Issue:	https://bugs.openjdk.java.net/browse/JDK-8160327
> Patch:	http://cr.openjdk.java.net/~bpb/8160327/webrev.00/
>
> Add thumbnail and standard metadata Document/ImageCreationTime from the APP1 Exif marker segment if present
>
> The code has been tested using JPEG-Exif images with compressed thumbnails from Canon, Nikon, and Olympus cameras, and using a JPEG-Exif image with an uncompressed thumbnail from a Sony camera.
>
> Thanks,
>
> Brian



More information about the 2d-dev mailing list