Merge pull request #2 from laurentiuilie/add-support-for-heifs-file

Add support for heifs file
This commit is contained in:
Paul 2020-07-27 10:04:13 +02:00 committed by GitHub
commit 5a00c1aa34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

BIN
testdata/test3.heic vendored Normal file

Binary file not shown.

View file

@ -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 {

View file

@ -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
}