mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-15 10:25:55 -07:00
Support PNG output on older libvips versions
This commit is contained in:
parent
a8f6d5fa08
commit
3ad09de9c4
1 changed files with 10 additions and 1 deletions
11
vips.h
11
vips.h
|
|
@ -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…
Add table
Add a link
Reference in a new issue