diff --git a/vips/foreign.c b/vips/foreign.c index ceac6945..f8c65dcd 100644 --- a/vips/foreign.c +++ b/vips/foreign.c @@ -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; } diff --git a/vips/govips.go b/vips/govips.go index 5bd3aa3c..8f8b6320 100644 --- a/vips/govips.go +++ b/vips/govips.go @@ -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") diff --git a/vips/image_test.go b/vips/image_test.go index cb094c98..8aa0b03c 100644 --- a/vips/image_test.go +++ b/vips/image_test.go @@ -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")