Support PNG output on older libvips versions

master
Fernando Costa 3 years ago
parent a8f6d5fa08
commit 3ad09de9c4

@ -336,7 +336,7 @@ vips_jpegsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int qual
int int
vips_pngsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int compression, int quality, int interlace, int palette, int speed) { 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) #if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 12)
int effort = 10 - speed; int effort = 10 - speed;
return vips_pngsave_buffer(in, buf, len, return vips_pngsave_buffer(in, buf, len,
"strip", INT_TO_GBOOLEAN(strip), "strip", INT_TO_GBOOLEAN(strip),
@ -348,6 +348,15 @@ vips_pngsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int compr
"effort", effort, "effort", effort,
NULL NULL
); );
#elif (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 #else
return vips_pngsave_buffer(in, buf, len, return vips_pngsave_buffer(in, buf, len,
"strip", INT_TO_GBOOLEAN(strip), "strip", INT_TO_GBOOLEAN(strip),

Loading…
Cancel
Save