hrev54197 adds 1 changeset to branch 'master'
old head: 11d6332fe8bea224e886402561bd6be35da186a6
new head: 0f161e01367b0909b83e878ca282588823976056
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=0f161e01367b+%5E11d6332fe8be
----------------------------------------------------------------------------
0f161e01367b: Improve SVG sniffing
The way this rule works is it check two things:
- The document starts with "<?xml", "<svg", or "<DOCTYPE"
- In the first 512 bytes there is either an SVG or DOCTYPE SVG opening
tag (both casze insensitive)
This should allow to correctly detect most SVG files, all while not
misdetecting other things (for example xhtml with a nested SVG) too
easily. It's difficult to be completely accurate with just a sniffing
rule.
Change-Id: I66d6e21ff694c4a6349989db2685dffb44ef5767
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2681
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>
[ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev54197
Commit: 0f161e01367b0909b83e878ca282588823976056
URL: https://git.haiku-os.org/haiku/commit/?id=0f161e01367b
Author: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date: Mon May 11 09:25:08 2020 UTC
Committer: Adrien Destugues <pulkomandy@xxxxxxxxx>
Commit-Date: Wed May 13 18:22:04 2020 UTC
----------------------------------------------------------------------------
1 file changed, 1 insertion(+), 1 deletion(-)
src/data/mime_db/image/svg+xml | 2 +-
----------------------------------------------------------------------------
diff --git a/src/data/mime_db/image/svg+xml b/src/data/mime_db/image/svg+xml
index cd5435e768..c52f8fe381 100644
--- a/src/data/mime_db/image/svg+xml
+++ b/src/data/mime_db/image/svg+xml
@@ -6,7 +6,7 @@ resource(1, "META:TYPE") "image/svg+xml";
resource(2, "META:S:DESC") #'MSDC' "SVG image";
resource(3, "META:SNIFF_RULE") #'CSTR' array {
- "0.60 (\"<?xml\" | \"<svg\") [0:511] ( -i \"<SVG\" | \"<!DOCTYPE SVG\"
)"
+ "0.60 (\"<?xml\" | \"<svg\" | \"<DOCTYPE\") [0:511] ( -i \"<SVG\" |
\"<!DOCTYPE SVG\" )"
};
resource(4, "META:PREF_APP") #'MSIG' "application/x-vnd.Haiku-WebPositive";