diff --git a/type_test.go b/type_test.go index b62b818..f3ee219 100644 --- a/type_test.go +++ b/type_test.go @@ -20,6 +20,7 @@ func TestDeterminateImageType(t *testing.T) { {"test.svg", SVG}, {"test.jp2", MAGICK}, {"test.heic", HEIF}, + {"test2.heic", HEIF}, } for _, file := range files { diff --git a/vips.go b/vips.go index 0d93a60..afe4519 100644 --- a/vips.go +++ b/vips.go @@ -646,6 +646,12 @@ func vipsImageType(buf []byte) ImageType { // https://github.com/strukturag/libheif/issues/83#issuecomment-421427091 if IsTypeSupported(HEIF) && buf[4] == 0x66 && buf[5] == 0x74 && buf[6] == 0x79 && buf[7] == 0x70 && buf[8] == 0x68 && buf[9] == 0x65 && buf[10] == 0x69 && buf[11] == 0x63 { + // This is a HEIC file + return HEIF + } + if IsTypeSupported(HEIF) && buf[4] == 0x66 && buf[5] == 0x74 && buf[6] == 0x79 && buf[7] == 0x70 && + buf[8] == 0x6d && buf[9] == 0x69 && buf[10] == 0x66 && buf[11] == 0x31 { + // This is a HEIF file return HEIF }