Parcourir la source

allow heix ftype brand for heifs (#1341)

* allow heix ftype brand for heifs

* use bytes not strings
James Tomson il y a 6 mois
Parent
commit
5bce3c7c66
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      imagemeta/heif.go

+ 2 - 1
imagemeta/heif.go

@@ -14,6 +14,7 @@ import (
 const heifBoxHeaderSize = uint64(8)
 
 var heicBrand = []byte("heic")
+var heixBrand = []byte("heix")
 var avifBrand = []byte("avif")
 var heifPict = []byte("pict")
 
@@ -93,7 +94,7 @@ func heifReadBoxHeader(r io.Reader) (boxType string, boxDataSize uint64, err err
 }
 
 func heifAssignFormat(d *heifData, brand []byte) bool {
-	if bytes.Equal(brand, heicBrand) {
+	if bytes.Equal(brand, heicBrand) || bytes.Equal(brand, heixBrand) {
 		d.Format = imagetype.HEIC
 		return true
 	}