Add GIF save support from libvips 8.12

This commit is contained in:
lucor 2022-01-11 14:51:12 +01:00
parent 78145aa405
commit 2f73f4d9e0
No known key found for this signature in database
GPG key ID: 5AB05891A4905007
4 changed files with 39 additions and 5 deletions

17
vips.h
View file

@ -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;
}
@ -407,6 +412,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;