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 <eylles@noreply.codeberg.org>
This commit is contained in:
NRK 2024-06-27 12:38:49 +00:00
parent b3eab414dd
commit 99e941271d

View file

@ -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);