BufferedImage image = dir.getThumbnail();
if (null != image) {
return image;
}
final JpegImageData jpegImageData = dir.getJpegImageData();
if (jpegImageData != null) {
// JPEG thumbnail as JPEG or other format; try to parse.
boolean imageSucceeded = false;
try {
image = Imaging.getBufferedImage(jpegImageData.data);