Skip to content

Commit

Permalink
- try conditional instead
Browse files Browse the repository at this point in the history
  • Loading branch information
elad laufer committed Nov 22, 2021
1 parent d700ea7 commit b8a88cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion vips/foreign.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ int load_image_buffer(LoadParams *params, void *buf, size_t len,
code = vips_heifload_buffer(buf, len, out, "page", params->page, "n",
params->n, "thumbnail", params->heifThumbnail,
"autorotate", params->autorotate, NULL);
} else if (imageType == JP2K) {

}
#if (VIPS_MAJOR_VERSION >= 8) && (VIPS_MINOR_VERSION >= 11)
else if (imageType == JP2K) {
code = vips_jp2kload_buffer(buf, len, out, "page", params->page, NULL);
}
#endif

return code;
}
Expand Down
4 changes: 2 additions & 2 deletions vips/govips.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func Startup(config *Config) {
panic("govips requires libvips version 8.10+")
}

if C.VIPS_MAJOR_VERSION == 8 && C.VIPS_MINOR_VERSION < 11 {
panic("govips requires libvips version 8.11+")
if C.VIPS_MAJOR_VERSION == 8 && C.VIPS_MINOR_VERSION < 10 {
panic("govips requires libvips version 8.10+")
}

cName := C.CString("govips")
Expand Down
3 changes: 3 additions & 0 deletions vips/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,9 @@ func TestImageRef_AVIF(t *testing.T) {
}

func TestImageRef_JP2K(t *testing.T) {
if MajorVersion == 8 && MinorVersion < 11 {
t.Skip("JPEG2000 is only supported in vips 8.11+")
}
Startup(nil)

raw, err := ioutil.ReadFile(resources + "jp2k-orientation-6.jp2")
Expand Down

0 comments on commit b8a88cd

Please sign in to comment.