mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-23 11:14:48 +02:00
Min libvips version is 8.10
This commit is contained in:
parent
d956a702b7
commit
a55776e561
@ -112,17 +112,6 @@ func transformAnimated(ctx context.Context, img *vips.Image, po *options.Process
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy fields
|
|
||||||
// TODO: remove this in major update
|
|
||||||
gifLoop, err := img.GetIntDefault("gif-loop", -1)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
gifDelay, err := img.GetIntDefault("gif-delay", -1)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
watermarkEnabled := po.Watermark.Enabled
|
watermarkEnabled := po.Watermark.Enabled
|
||||||
po.Watermark.Enabled = false
|
po.Watermark.Enabled = false
|
||||||
defer func() { po.Watermark.Enabled = watermarkEnabled }()
|
defer func() { po.Watermark.Enabled = watermarkEnabled }()
|
||||||
@ -182,15 +171,6 @@ func transformAnimated(ctx context.Context, img *vips.Image, po *options.Process
|
|||||||
img.SetInt("loop", loop)
|
img.SetInt("loop", loop)
|
||||||
img.SetInt("n-pages", framesCount)
|
img.SetInt("n-pages", framesCount)
|
||||||
|
|
||||||
// Legacy fields
|
|
||||||
// TODO: remove this in major update
|
|
||||||
if gifLoop >= 0 {
|
|
||||||
img.SetInt("gif-loop", gifLoop)
|
|
||||||
}
|
|
||||||
if gifDelay >= 0 {
|
|
||||||
img.SetInt("gif-delay", gifDelay)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
vips/vips.c
26
vips/vips.c
@ -1,12 +1,6 @@
|
|||||||
#include "vips.h"
|
#include "vips.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define VIPS_SUPPORT_ARRAY_HEADERS \
|
|
||||||
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 9))
|
|
||||||
|
|
||||||
#define VIPS_SUPPORT_AVIF \
|
|
||||||
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 9))
|
|
||||||
|
|
||||||
#define VIPS_SUPPORT_AVIF_SPEED \
|
#define VIPS_SUPPORT_AVIF_SPEED \
|
||||||
(VIPS_MAJOR_VERSION > 8 || \
|
(VIPS_MAJOR_VERSION > 8 || \
|
||||||
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION > 10) || \
|
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION > 10) || \
|
||||||
@ -15,9 +9,6 @@
|
|||||||
#define VIPS_SUPPORT_AVIF_EFFORT \
|
#define VIPS_SUPPORT_AVIF_EFFORT \
|
||||||
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 12))
|
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 12))
|
||||||
|
|
||||||
#define VIPS_SUPPORT_PNG_BITDEPTH \
|
|
||||||
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 10))
|
|
||||||
|
|
||||||
#define VIPS_SUPPORT_GIFSAVE \
|
#define VIPS_SUPPORT_GIFSAVE \
|
||||||
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 12))
|
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 12))
|
||||||
|
|
||||||
@ -150,19 +141,12 @@ vips_is_animated(VipsImage * in) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
vips_image_get_array_int_go(VipsImage *image, const char *name, int **out, int *n) {
|
vips_image_get_array_int_go(VipsImage *image, const char *name, int **out, int *n) {
|
||||||
#if VIPS_SUPPORT_ARRAY_HEADERS
|
|
||||||
return vips_image_get_array_int(image, name, out, n);
|
return vips_image_get_array_int(image, name, out, n);
|
||||||
#else
|
|
||||||
vips_error("vips_image_get_array_int_go", "Array headers are not supported (libvips 8.9+ reuired)");
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vips_image_set_array_int_go(VipsImage *image, const char *name, const int *array, int n) {
|
vips_image_set_array_int_go(VipsImage *image, const char *name, const int *array, int n) {
|
||||||
#if VIPS_SUPPORT_ARRAY_HEADERS
|
|
||||||
vips_image_set_array_int(image, name, array, n);
|
vips_image_set_array_int(image, name, array, n);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -601,13 +585,8 @@ vips_pngsave_go(VipsImage *in, void **buf, size_t *len, int interlace, int quant
|
|||||||
in, buf, len,
|
in, buf, len,
|
||||||
"filter", VIPS_FOREIGN_PNG_FILTER_NONE,
|
"filter", VIPS_FOREIGN_PNG_FILTER_NONE,
|
||||||
"interlace", interlace,
|
"interlace", interlace,
|
||||||
#if VIPS_SUPPORT_PNG_BITDEPTH
|
|
||||||
"palette", quantize,
|
"palette", quantize,
|
||||||
"bitdepth", bitdepth,
|
"bitdepth", bitdepth,
|
||||||
#else // VIPS_SUPPORT_PNG_BITDEPTH
|
|
||||||
"palette", quantize,
|
|
||||||
"colours", colors,
|
|
||||||
#endif // VIPS_SUPPORT_PNG_BITDEPTH
|
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -638,7 +617,6 @@ vips_tiffsave_go(VipsImage *in, void **buf, size_t *len, int quality) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
vips_avifsave_go(VipsImage *in, void **buf, size_t *len, int quality, int speed) {
|
vips_avifsave_go(VipsImage *in, void **buf, size_t *len, int quality, int speed) {
|
||||||
#if VIPS_SUPPORT_AVIF
|
|
||||||
return vips_heifsave_buffer(
|
return vips_heifsave_buffer(
|
||||||
in, buf, len,
|
in, buf, len,
|
||||||
"Q", quality,
|
"Q", quality,
|
||||||
@ -649,10 +627,6 @@ vips_avifsave_go(VipsImage *in, void **buf, size_t *len, int quality, int speed)
|
|||||||
"speed", speed,
|
"speed", speed,
|
||||||
#endif
|
#endif
|
||||||
NULL);
|
NULL);
|
||||||
#else
|
|
||||||
vips_error("vips_avifsave_go", "Saving AVIF is not supported (libvips 8.9+ reuired)");
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user