mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 13:38:16 -08:00
Merge pull request #423 from ffawkes/png-output
Support PNG output on older libvips versions
This commit is contained in:
commit
3471b468e9
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
|
||||
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…
Add table
Add a link
Reference in a new issue