Merge pull request #423 from ffawkes/png-output

Support PNG output on older libvips versions
master
Tom 3 years ago committed by GitHub
commit 3471b468e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -336,7 +336,7 @@ 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, int speed) {
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 7)
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 12)
int effort = 10 - speed;
return vips_pngsave_buffer(in, buf, len,
"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,
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
return vips_pngsave_buffer(in, buf, len,
"strip", INT_TO_GBOOLEAN(strip),

Loading…
Cancel
Save