mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
Merge pull request #393 from lucor/gifsave
Add GIF save support from libvips 8.12
This commit is contained in:
commit
e9e8495e96
4 changed files with 39 additions and 5 deletions
17
vips.h
17
vips.h
|
|
@ -185,6 +185,11 @@ vips_type_find_save_bridge(int t) {
|
|||
if (t == HEIF) {
|
||||
return vips_type_find("VipsOperation", "heifsave_buffer");
|
||||
}
|
||||
#endif
|
||||
#if (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 12))
|
||||
if (t == GIF) {
|
||||
return vips_type_find("VipsOperation", "gifsave_buffer");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -410,6 +415,18 @@ vips_heifsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int qual
|
|||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
vips_gifsave_bridge(VipsImage *in, void **buf, size_t *len, int strip) {
|
||||
#if (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 12))
|
||||
return vips_gifsave_buffer(in, buf, len,
|
||||
"strip", INT_TO_GBOOLEAN(strip),
|
||||
NULL
|
||||
);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
vips_is_16bit (VipsInterpretation interpretation) {
|
||||
return interpretation == VIPS_INTERPRETATION_RGB16 || interpretation == VIPS_INTERPRETATION_GREY16;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue