1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-03-27 20:30:27 +02:00

Fix build with libvips < 8.6

This commit is contained in:
DarthSim 2020-02-27 18:40:54 +06:00
parent 8ed83e973e
commit 5d3b8f19fc
2 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,7 @@
### Fixed ### Fixed
- Fix loadind BMP stored in ICO. - Fix loadind BMP stored in ICO.
- Fix ambiguous HEIC magic bytes (MP4 videos has been detected as HEIC). - Fix ambiguous HEIC magic bytes (MP4 videos has been detected as HEIC).
- Fix build with libvips < 8.6.
## [2.10.0] - 2020-02-13 ## [2.10.0] - 2020-02-13
### Added ### Added

8
vips.c
View File

@ -37,6 +37,9 @@
#define VIPS_SUPPORT_COMPOSITE \ #define VIPS_SUPPORT_COMPOSITE \
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 6)) (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 6))
#define VIPS_SUPPORT_FIND_TRIM \
(VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 6))
#define EXIF_ORIENTATION "exif-ifd0-Orientation" #define EXIF_ORIENTATION "exif-ifd0-Orientation"
#if (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 8)) #if (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 8))
@ -396,6 +399,7 @@ vips_extract_area_go(VipsImage *in, VipsImage **out, int left, int top, int widt
int int
vips_trim(VipsImage *in, VipsImage **out, double threshold) { vips_trim(VipsImage *in, VipsImage **out, double threshold) {
#if VIPS_SUPPORT_FIND_TRIM
VipsImage *tmp; VipsImage *tmp;
if (vips_image_hasalpha(in)) { if (vips_image_hasalpha(in)) {
@ -434,6 +438,10 @@ vips_trim(VipsImage *in, VipsImage **out, double threshold) {
} }
return vips_extract_area(in, out, left, top, width, height, NULL); return vips_extract_area(in, out, left, top, width, height, NULL);
#else
vips_error("vips_trim", "Trim is not supported (libvips 8.6+ reuired)");
return 1;
#endif
} }
int int