diff --git a/testdata/test3.heic b/testdata/test3.heic new file mode 100644 index 0000000..bbe7b48 Binary files /dev/null and b/testdata/test3.heic differ diff --git a/type_test.go b/type_test.go index 48531ea..7c4b1fa 100644 --- a/type_test.go +++ b/type_test.go @@ -21,6 +21,7 @@ func TestDeterminateImageType(t *testing.T) { // {"test.jp2", MAGICK}, {"test.heic", HEIF}, {"test2.heic", HEIF}, + {"test3.heic", HEIF}, } for _, file := range files { diff --git a/vips.go b/vips.go index 2e233eb..0d1cae5 100644 --- a/vips.go +++ b/vips.go @@ -693,6 +693,11 @@ func vipsImageType(buf []byte) ImageType { // This is a HEIF file return HEIF } + if IsTypeSupported(HEIF) && buf[4] == 0x66 && buf[5] == 0x74 && buf[6] == 0x79 && buf[7] == 0x70 && + buf[8] == 0x6d && buf[9] == 0x73 && buf[10] == 0x66 && buf[11] == 0x31 { + // This is a HEIFS file + return HEIF + } return UNKNOWN }