support Palette option for png

This commit is contained in:
Azuma Fan 2020-06-08 16:43:04 +08:00
parent 3a950d13cd
commit dfd363a962
4 changed files with 8 additions and 3 deletions

5
vips.h
View file

@ -309,13 +309,14 @@ 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) {
#if (VIPS_MAJOR_VERSION >= 8 || (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 42))
vips_pngsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int compression, int quality, int interlace, int palette) {
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 7)
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),
NULL
);
#else