瀏覽代碼

Fix heic magic bytes

DarthSim 5 年之前
父節點
當前提交
36ad0d31e2
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 1 0
      CHANGELOG.md
  2. 9 2
      imagemeta/heic.go

+ 1 - 0
CHANGELOG.md

@@ -3,6 +3,7 @@
 ## [Unreleased]
 ### Fixed
 - Fix loadind BMP stored in ICO.
+- Fix ambiguous HEIC magic bytes (MP4 videos has been detected as HEIC).
 
 ## [2.10.0] - 2020-02-13
 ### Added

+ 9 - 2
imagemeta/heic.go

@@ -140,7 +140,7 @@ func heicReadBoxes(d *heicDimensionsData, r io.Reader) error {
 				return err
 			}
 			if !d.IsFilled() {
-				return errors.New("Dimensions data wan't found in meta box")
+				return errors.New("Dimensions data wasn't found in meta box")
 			}
 			return nil
 		case "hdlr":
@@ -184,5 +184,12 @@ func DecodeHeicMeta(r io.Reader) (Meta, error) {
 }
 
 func init() {
-	RegisterFormat("????ftyp", DecodeHeicMeta)
+	RegisterFormat("????ftypheic", DecodeHeicMeta)
+	RegisterFormat("????ftypheix", DecodeHeicMeta)
+	RegisterFormat("????ftyphevc", DecodeHeicMeta)
+	RegisterFormat("????ftypheim", DecodeHeicMeta)
+	RegisterFormat("????ftypheis", DecodeHeicMeta)
+	RegisterFormat("????ftyphevm", DecodeHeicMeta)
+	RegisterFormat("????ftyphevs", DecodeHeicMeta)
+	RegisterFormat("????ftypmif1", DecodeHeicMeta)
 }