allow effort param for png encoding when palette is true

This commit is contained in:
Vaibhav Sharma 2022-02-16 16:09:13 +05:30
parent 83be955624
commit 0b6895720c
4 changed files with 11 additions and 3 deletions

5
vips.h
View file

@ -330,14 +330,17 @@ vips_jpegsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int qual
}
int
vips_pngsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int compression, int quality, int interlace, int palette) {
vips_pngsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int compression, int quality, int interlace, int palette, int speed) {
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 7)
int effort = 10 - speed;
return vips_pngsave_buffer(in, buf, len,
"strip", INT_TO_GBOOLEAN(strip),
"compression", compression,
"interlace", INT_TO_GBOOLEAN(interlace),
"filter", VIPS_FOREIGN_PNG_FILTER_ALL,
"palette", INT_TO_GBOOLEAN(palette),
"Q", quality,
"effort", effort,
NULL
);
#else