summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/gen-xhtml-thumbnails14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/gen-xhtml-thumbnails b/bin/gen-xhtml-thumbnails
index dc44ce7..155ba1f 100755
--- a/bin/gen-xhtml-thumbnails
+++ b/bin/gen-xhtml-thumbnails
@@ -104,10 +104,16 @@ foreach my $file (sort(@files)) {
($dx, $dy) = ($image->width, $image->height);
- if ($dx > $dy) {
- $thumb = $image->create_scaled_image(THUMB_MAX_DIM, 0);
- } else {
- $thumb = $image->create_scaled_image(0, THUMB_MAX_DIM);
+ if ($dx > THUMB_MAX_DIM and $dy > THUMB_MAX_DIM) {
+ if ($dx > $dy) {
+ $thumb = $image->create_scaled_image(THUMB_MAX_DIM, 0);
+ }
+ else {
+ $thumb = $image->create_scaled_image(0, THUMB_MAX_DIM);
+ }
+ }
+ else {
+ $thumb = $image;
}
$thumb->set_quality(THUMB_QUALITY);