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