- final double thumbWidthToHeightRatio = (double) desiredTargetDimension.width
- / (double) desiredTargetDimension.height;
- final double inputImageWidthToHeightRatio = (double) originalImageDimension.width
- / (double) originalImageDimension.height;
+ /**
+ * Actual returned target thumbnail size will be adjusted from desired one
+ * by attempting to generate as large as possible thumbnail, while not
+ * exceeding provided thumbnail width and height, and preserving aspect
+ * ratio of original image.
+ */
+ private static java.awt.Dimension getTargetThumbnailDimension(
+ final java.awt.Dimension originalImageDimension,
+ final java.awt.Dimension desiredTargetDimension) {