Merge pull request #393 from lucor/gifsave

Add GIF save support from libvips 8.12
This commit is contained in:
Tom 2022-04-05 21:13:02 +02:00 committed by GitHub
commit e9e8495e96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;
}
@ -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;