summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-09-29 14:05:04 +0200
committerBert Münnich <ber.t@posteo.de>2014-09-29 14:05:04 +0200
commit390d771e7035f089d95a7552a9c9fdf41caf1ea6 (patch)
treee7c6aec6bf814e9d1d94104a85dd9f24ef2e1606
parent0e4db69ff5dc0ebc863af03117caab39c725893f (diff)
downloadnsxiv-390d771e7035f089d95a7552a9c9fdf41caf1ea6.tar.zst
Fixed thumbnail creation for files with big aspect ratio factor; fixes issue #175
-rw-r--r--thumbs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/thumbs.c b/thumbs.c
index 81d4a6a..8f129fb 100644
--- a/thumbs.c
+++ b/thumbs.c
@@ -226,7 +226,8 @@ Imlib_Image tns_scale_down(Imlib_Image im, int dim)
if (z < 1.0) {
imlib_context_set_anti_alias(1);
- im = imlib_create_cropped_scaled_image(0, 0, w, h, z * w, z * h);
+ im = imlib_create_cropped_scaled_image(0, 0, w, h,
+ MAX(z * w, 1), MAX(z * h, 1));
if (im == NULL)
die("could not allocate memory");
imlib_free_image_and_decache();