浏览代码

Add image format pattern.
("borrowed" from RenderImage)

j433866 6 年之前
父节点
当前提交
11451ac6b9
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/core/operations/ParseQRCode.mjs

+ 8 - 0
src/core/operations/ParseQRCode.mjs

@@ -33,6 +33,14 @@ class ParseQRCode extends Operation {
                 "value": false
             }
         ];
+        this.patterns = [
+            {
+                "match": "^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)",
+                "flags": "",
+                "args": [false],
+                "useful": true
+            }
+        ];
     }
 
     /**