From 99e941271d741a198b592186745a9f735896f286 Mon Sep 17 00:00:00 2001 From: NRK Date: Thu, 27 Jun 2024 12:38:49 +0000 Subject: use compression level 8 when writing png thumbnails (#505) by default imlib2 uses a compression level of 2 for writing pngs, which is rather low. a compression level of 8 should result in slightly lower thumbnail filesizes without affecting the encoding speed too much (since these thumbnails are very small already). Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/505 Reviewed-by: eylles --- thumbs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/thumbs.c b/thumbs.c index f55a152..159aad7 100644 --- a/thumbs.c +++ b/thumbs.c @@ -121,6 +121,7 @@ static void tns_cache_write(tns_t *tns, Imlib_Image im, const char *filepath, bo imlib_context_set_image(im); if (imlib_image_has_alpha()) { imlib_image_set_format("png"); + imlib_image_attach_data_value("compression", NULL, 8, NULL); } else { imlib_image_set_format("jpg"); imlib_image_attach_data_value("quality", NULL, 90, NULL); -- cgit v1.2.3-54-g00ecf