[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kimageformats] src/imageformats: Make WebP mimetype xml match the one in shared-mime-info-git
From:       Alex Merry <kde () randomguy3 ! me ! uk>
Date:       2014-02-20 12:56:30
Message-ID: E1WGTB0-0006VP-KR () scm ! kde ! org
[Download RAW message or body]

Git commit 30cff602964dd47379d8a7161768183fe4a64f19 by Alex Merry.
Committed on 12/02/2014 at 10:57.
Pushed by alexmerry into branch 'master'.

Make WebP mimetype xml match the one in shared-mime-info-git

This includes the detection magic and an alias for image/webp.  It
should be in shared-mime-info 1.3.

Proposed by Jerome Leclanche <adys.wh@gmail.com>.

REVIEW: 115355

M  +2    -0    src/imageformats/CMakeLists.txt
M  +6    -0    src/imageformats/webp.xml

http://commits.kde.org/kimageformats/30cff602964dd47379d8a7161768183fe4a64f19

diff --git a/src/imageformats/CMakeLists.txt b/src/imageformats/CMakeLists.txt
index 422515d..e2242a6 100644
--- a/src/imageformats/CMakeLists.txt
+++ b/src/imageformats/CMakeLists.txt
@@ -134,10 +134,12 @@ if(WebP_FOUND)
 
     find_package(SharedMimeInfo)
     set_package_properties(SharedMimeInfo PROPERTIES
+        # TODO: Make RUNTIME when we remove webp.xml
         TYPE RECOMMENDED
         PURPOSE "Required to install the WebP MIME Type information"
     )
     if (SharedMimeInfo_FOUND)
+        # TODO: Remove when we can depend on shared-mime-info 1.3
         install(FILES webp.xml DESTINATION ${XDG_MIME_INSTALL_DIR})
         update_xdg_mimetypes(${XDG_MIME_INSTALL_DIR})
     endif()
diff --git a/src/imageformats/webp.xml b/src/imageformats/webp.xml
index 4246f76..68ddbbf 100644
--- a/src/imageformats/webp.xml
+++ b/src/imageformats/webp.xml
@@ -2,6 +2,12 @@
 <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
   <mime-type type="image/x-webp">
     <comment>WebP image</comment>
+    <magic priority="50">
+      <match type="string" value="RIFF" offset="0">
+        <match type="string" value="WEBP" offset="8"/>
+      </match>
+    </magic>
+    <alias type="image/webp"/>
     <glob pattern="*.webp"/>
   </mime-type>
 </mime-info>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic