diff --git a/.travis.yml b/.travis.yml index 676a721..ba9e904 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ services: env: # - LIBVIPS=7.42.3 # - LIBVIPS=8.4.6 - # - LIBVIPS=8.5.8 - # - LIBVIPS=8.6.2 + - LIBVIPS=8.5.8 + - LIBVIPS=8.6.2 - LIBVIPS=8.7.4 # - LIBVIPS=8.8.4 - LIBVIPS=8.9.2 diff --git a/type.go b/type.go index ea7ef90..603dddf 100644 --- a/type.go +++ b/type.go @@ -6,6 +6,9 @@ import ( "unicode/utf8" ) +// ImageType represents an image type value. +type ImageType int + const ( // UNKNOWN represents an unknow image type value. UNKNOWN ImageType = iota @@ -29,9 +32,6 @@ const ( HEIF ) -// ImageType represents an image type value. -type ImageType int - var ( htmlCommentRegex = regexp.MustCompile("(?i)") svgRegex = regexp.MustCompile(`(?i)^\s*(?:<\?xml[^>]*>\s*)?(?:]*>\s*)?]*>[^*]*<\/svg>\s*$`) diff --git a/type_test.go b/type_test.go index b06e251..48531ea 100644 --- a/type_test.go +++ b/type_test.go @@ -53,6 +53,10 @@ func TestDeterminateImageTypeName(t *testing.T) { } for _, file := range files { + if file.expected == "heif" && VipsMajorVersion <= 8 && VipsMinorVersion < 8 { + continue + } + img, _ := os.Open(path.Join("testdata", file.name)) buf, _ := ioutil.ReadAll(img) defer img.Close() @@ -72,6 +76,9 @@ func TestIsTypeSupported(t *testing.T) { } for _, n := range types { + if n.name == HEIF && VipsMajorVersion <= 8 && VipsMinorVersion < 8 { + continue + } if IsTypeSupported(n.name) == false { t.Fatalf("Image type %s is not valid", ImageTypes[n.name]) } @@ -92,6 +99,9 @@ func TestIsTypeNameSupported(t *testing.T) { } for _, n := range types { + if n.name == "heif" && VipsMajorVersion <= 8 && VipsMinorVersion < 8 { + continue + } if IsTypeNameSupported(n.name) != n.expected { t.Fatalf("Image type %s is not valid", n.name) }