Skip to content

Commit

Permalink
Fix build with libvips < 8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthSim committed Feb 27, 2020
1 parent 8ed83e9 commit 5d3b8f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Fixed
- Fix loadind BMP stored in ICO.
- Fix ambiguous HEIC magic bytes (MP4 videos has been detected as HEIC).
- Fix build with libvips < 8.6.

## [2.10.0] - 2020-02-13
### Added
Expand Down
8 changes: 8 additions & 0 deletions vips.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#define VIPS_SUPPORT_COMPOSITE \
(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"

#if (VIPS_MAJOR_VERSION > 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION >= 8))
Expand Down Expand Up @@ -396,6 +399,7 @@ vips_extract_area_go(VipsImage *in, VipsImage **out, int left, int top, int widt

int
vips_trim(VipsImage *in, VipsImage **out, double threshold) {
#if VIPS_SUPPORT_FIND_TRIM
VipsImage *tmp;

if (vips_image_hasalpha(in)) {
Expand Down Expand Up @@ -434,6 +438,10 @@ vips_trim(VipsImage *in, VipsImage **out, double threshold) {
}

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
Expand Down

0 comments on commit 5d3b8f1

Please sign in to comment.