mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
Adds AVIF support
* This adds a new type AVIF to the supported type list if libvips >= 8.9.0 * Calls libheif through libvips with the AV1 compression set to save AVIF images.
This commit is contained in:
parent
4f683f98d8
commit
83c14048e0
9 changed files with 86 additions and 9 deletions
18
vips.h
18
vips.h
|
|
@ -34,6 +34,7 @@ enum types {
|
|||
SVG,
|
||||
MAGICK,
|
||||
HEIF,
|
||||
AVIF
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -335,7 +336,7 @@ vips_pngsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int compr
|
|||
"compression", compression,
|
||||
"interlace", INT_TO_GBOOLEAN(interlace),
|
||||
"filter", VIPS_FOREIGN_PNG_FILTER_ALL,
|
||||
"palette", INT_TO_GBOOLEAN(palette),
|
||||
"palette", INT_TO_GBOOLEAN(palette),
|
||||
NULL
|
||||
);
|
||||
#else
|
||||
|
|
@ -367,6 +368,21 @@ vips_tiffsave_bridge(VipsImage *in, void **buf, size_t *len) {
|
|||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
vips_avifsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int quality, int lossless) {
|
||||
#if (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 9))
|
||||
return vips_heifsave_buffer(in, buf, len,
|
||||
"strip", INT_TO_GBOOLEAN(strip),
|
||||
"Q", quality,
|
||||
"lossless", INT_TO_GBOOLEAN(lossless),
|
||||
"compression", VIPS_FOREIGN_HEIF_COMPRESSION_AV1,
|
||||
NULL
|
||||
);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
vips_heifsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int quality, int lossless) {
|
||||
#if (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 8))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue