- /**
- * 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.
- */
- public static java.awt.Dimension getTargetThumbnailDimension(
- final java.awt.Dimension originalImageDimension,
- final java.awt.Dimension desiredTargetDimension) {
+ private static final long serialVersionUID = -4156533490858298387L;
+ /**
+ * Picture dimensions.
+ */
+ private Dimension dimensions;
+
+ public Picture(final File parentDirectory, final String fileName)
+ throws Exception {
+ super(parentDirectory, fileName);
+ }
+
+ private static void ensureNonzeroImageArea(final java.awt.Dimension result) {
+ if (result.width < 1)
+ result.width = 1;
+ if (result.height < 1)
+ result.height = 1;
+ }
+
+ /**
+ * 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) {