Krolyxon
Commit 390d771

Branches

Refs →

nsxiv390d771

Fixed thumbnail creation for files with big aspect ratio factor; fixes issue #175

Author
Bert Münnich
Date
2014-09-29 14:05 +0200
Parent
0e4db69
Commit
390d771e7035f089d95a7552a9c9fdf41caf1ea6

+2 −1

1 file changed

  1. M thumbs.c +2 −1
M thumbs.c View
@@ -226,7 +226,8 @@ Imlib_Image tns_scale_down(Imlib_Image im, int dim)
226226
227227 if (z < 1.0) {
228228 imlib_context_set_anti_alias(1);
229− im = imlib_create_cropped_scaled_image(0, 0, w, h, z * w, z * h);
229+ im = imlib_create_cropped_scaled_image(0, 0, w, h,
230+ MAX(z * w, 1), MAX(z * h, 1));
230231 if (im == NULL)
231232 die("could not allocate memory");
232233 imlib_free_image_and_decache();