this.photoHash = HashUtils.computeSha256Hash(photoBytes);
photoStoreKey = createPhotoStoreKey(guestId, captureYYYYDDD, captureTimeMillisUtc, photoHash);
// Create the thumbnails: do so by creating the largest one first, and then creating the smaller
// ones from the larger--this should be faster than creating each from the original image
final Image thumbnail2Image = ImageUtils.createJpegThumbnail(photoBytes, THUMBNAIL_2_MAX_SIDE_LENGTH_IN_PIXELS);
if (thumbnail2Image == null) {
throw new IOException("Failed to create thumbnails");
}
final Image thumbnail1Image = ImageUtils.createJpegThumbnail(thumbnail2Image.getBytes(), THUMBNAIL_1_MAX_SIDE_LENGTH_IN_PIXELS);
if (thumbnail1Image == null) {
throw new IOException("Failed to create thumbnails");
}
final Image thumbnail0Image = ImageUtils.createJpegThumbnail(thumbnail1Image.getBytes(), THUMBNAIL_0_MAX_SIDE_LENGTH_IN_PIXELS);
if (thumbnail0Image == null) {
throw new IOException("Failed to create thumbnails");
}
thumbnail0 = thumbnail0Image.getBytes();
thumbnail1 = thumbnail1Image.getBytes();
thumbnail2 = thumbnail2Image.getBytes();
thumbnail0Size = new Dimension(thumbnail0Image.getWidth(), thumbnail0Image.getHeight());
thumbnail1Size = new Dimension(thumbnail1Image.getWidth(), thumbnail1Image.getHeight());
thumbnail2Size = new Dimension(thumbnail2Image.getWidth(), thumbnail2Image.getHeight());
// get the image orientation, and default to ORIENTATION_1 if unspecified
ImageOrientation orientationTemp;