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:
parent
b3eab414dd
commit
99e941271d
1
thumbs.c
1
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);
|
imlib_context_set_image(im);
|
||||||
if (imlib_image_has_alpha()) {
|
if (imlib_image_has_alpha()) {
|
||||||
imlib_image_set_format("png");
|
imlib_image_set_format("png");
|
||||||
|
imlib_image_attach_data_value("compression", NULL, 8, NULL);
|
||||||
} else {
|
} else {
|
||||||
imlib_image_set_format("jpg");
|
imlib_image_set_format("jpg");
|
||||||
imlib_image_attach_data_value("quality", NULL, 90, NULL);
|
imlib_image_attach_data_value("quality", NULL, 90, NULL);
|
||||||
|
|
Loading…
Reference in a new issue