Skip to content

Commit

Permalink
Merge pull request kumparan#3 from laurentiuilie/add-support-for-heif…
Browse files Browse the repository at this point in the history
…s-file

add brands heis, hevc
  • Loading branch information
vansante authored Jul 28, 2020
2 parents 5a00c1a + bb682d7 commit e490c75
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions vips.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,17 +685,27 @@ 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
// This is a HEIC file, ftypheic
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
// This is a HEIF file, ftypmif1
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
// This is a HEIFS file, ftypmsf1
return HEIF
}
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] == 0x73 {
// This is a HEIFS file, ftypheis
return HEIF
}
if IsTypeSupported(HEIF) && buf[4] == 0x66 && buf[5] == 0x74 && buf[6] == 0x79 && buf[7] == 0x70 &&
buf[8] == 0x68 && buf[9] == 0x65 && buf[10] == 0x76 && buf[11] == 0x63 {
// This is a HEIFS file, ftyphevc
return HEIF
}

Expand Down

0 comments on commit e490c75

Please sign in to comment.