浏览代码

Add <!-- as magic bytes for SVG detection

DarthSim 5 年之前
父节点
当前提交
6db5b8e90b
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 2 0
      CHANGELOG.md
  2. 2 0
      imagemeta/svg.go

+ 2 - 0
CHANGELOG.md

@@ -1,6 +1,8 @@
 # Changelog
 
 ## [Unreleased]
+### Fixed
+- Fix detection of SVG starting with a comment.
 
 ## [2.9.0] - 2020-01-30
 ### Added

+ 2 - 0
imagemeta/svg.go

@@ -12,4 +12,6 @@ func init() {
 	}
 	RegisterFormat("<?xml ", decodeMeta)
 	RegisterFormat("<svg", decodeMeta)
+	// We believe that file starting with HTML comment is SVG
+	RegisterFormat("<!--", decodeMeta)
 }