Author: jukka
Date: Tue Feb  3 22:13:23 2009
New Revision: 740478

URL: http://svn.apache.org/viewvc?rev=740478&view=rev
Log:
TIKA-192: Add glob and magic patterns for image types

Added glob patterns for numerous camera raw file formats.

Modified:
    lucene/tika/trunk/src/main/resources/mime/tika-mimetypes.xml
    lucene/tika/trunk/src/test/java/org/apache/tika/mime/TestMimeTypes.java

Modified: lucene/tika/trunk/src/main/resources/mime/tika-mimetypes.xml
URL: 
http://svn.apache.org/viewvc/lucene/tika/trunk/src/main/resources/mime/tika-mimetypes.xml?rev=740478&r1=740477&r2=740478&view=diff
==============================================================================
--- lucene/tika/trunk/src/main/resources/mime/tika-mimetypes.xml (original)
+++ lucene/tika/trunk/src/main/resources/mime/tika-mimetypes.xml Tue Feb  3 
22:13:23 2009
@@ -1079,6 +1079,122 @@
     <glob pattern="*.ppm" />
   </mime-type>
 
+  <mime-type type="image/x-tika-dng">
+    <acronym>DNG</acronym>
+    <comment>Adobe Digital Negative</comment>
+    <glob pattern="*.dng" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-hasselblad">
+    <comment>Hasselblad raw image</comment>
+    <glob pattern="*.3fr" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-fuji">
+    <comment>Fuji raw image</comment>
+    <glob pattern="*.raf" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-canon">
+    <comment>Canon raw image</comment>
+    <glob pattern="*.crw" />
+    <glob pattern="*.cr2" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-kodak">
+    <comment>Kodak raw image</comment>
+    <glob pattern="*.k25" />
+    <glob pattern="*.kdc" />
+    <glob pattern="*.dcs" />
+    <glob pattern="*.drf" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-minolta">
+    <comment>Minolta raw image</comment>
+    <glob pattern="*.mrw" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-nikon">
+    <comment>Nikon raw image</comment>
+    <glob pattern="*.nef" />
+    <glob pattern="*.nrw" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-olympus">
+    <comment>Olympus raw image</comment>
+    <glob pattern="*.orf" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-pentax">
+    <comment>Pentax raw image</comment>
+    <glob pattern="*.ptx" />
+    <glob pattern="*.pef" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-sony">
+    <comment>Sony raw image</comment>
+    <glob pattern="*.arw" />
+    <glob pattern="*.srf" />
+    <glob pattern="*.sr2" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-sigma">
+    <comment>Sigma raw image</comment>
+    <glob pattern="*.x3f" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-epson">
+    <comment>Epson raw image</comment>
+    <glob pattern="*.erf" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-mamiya">
+    <comment>Mamiya raw image</comment>
+    <glob pattern="*.mef" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-leaf">
+    <comment>Leaf raw image</comment>
+    <glob pattern="*.mos" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-panasonic">
+    <comment>Panasonic raw image</comment>
+    <glob pattern="*.raw" />
+    <glob pattern="*.rw2" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-phaseone">
+    <comment>Phase One raw image</comment>
+    <glob pattern="*.cap" />
+    <glob pattern="*.iiq" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-red">
+    <comment>Red raw image</comment>
+    <glob pattern="*.r3d" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-imacon">
+    <comment>Imacon raw image</comment>
+    <glob pattern="*.fff" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-logitech">
+    <comment>Logitech raw image</comment>
+    <glob pattern="*.pxn" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-casio">
+    <comment>Casio raw image</comment>
+    <glob pattern="*.bay" />
+  </mime-type>
+
+  <mime-type type="image/x-tika-rawzor">
+    <comment>Rawzor raw image</comment>
+    <glob pattern="*.rwz" />
+  </mime-type>
+
   <mime-type type="message/news">
     <magic priority="50">
       <match value="Path:" type="string" offset="0" />

Modified: 
lucene/tika/trunk/src/test/java/org/apache/tika/mime/TestMimeTypes.java
URL: 
http://svn.apache.org/viewvc/lucene/tika/trunk/src/test/java/org/apache/tika/mime/TestMimeTypes.java?rev=740478&r1=740477&r2=740478&view=diff
==============================================================================
--- lucene/tika/trunk/src/test/java/org/apache/tika/mime/TestMimeTypes.java 
(original)
+++ lucene/tika/trunk/src/test/java/org/apache/tika/mime/TestMimeTypes.java Tue 
Feb  3 22:13:23 2009
@@ -153,6 +153,42 @@
         assertTypeByName("image/x-portable-pixmap", "x.PPM");
     }
 
+    public void testRawDetection() throws Exception {
+        assertTypeByName("image/x-tika-dng", "x.dng");
+        assertTypeByName("image/x-tika-dng", "x.DNG");
+        assertTypeByName("image/x-tika-hasselblad", "x.3fr");
+        assertTypeByName("image/x-tika-fuji", "x.raf");
+        assertTypeByName("image/x-tika-canon", "x.crw");
+        assertTypeByName("image/x-tika-canon", "x.cr2");
+        assertTypeByName("image/x-tika-kodak", "x.k25");
+        assertTypeByName("image/x-tika-kodak", "x.kdc");
+        assertTypeByName("image/x-tika-kodak", "x.dcs");
+        assertTypeByName("image/x-tika-kodak", "x.drf");
+        assertTypeByName("image/x-tika-minolta", "x.mrw");
+        assertTypeByName("image/x-tika-nikon", "x.nef");
+        assertTypeByName("image/x-tika-nikon", "x.nrw");
+        assertTypeByName("image/x-tika-olympus", "x.orf");
+        assertTypeByName("image/x-tika-pentax", "x.ptx");
+        assertTypeByName("image/x-tika-pentax", "x.pef");
+        assertTypeByName("image/x-tika-sony", "x.arw");
+        assertTypeByName("image/x-tika-sony", "x.srf");
+        assertTypeByName("image/x-tika-sony", "x.sr2");
+        assertTypeByName("image/x-tika-sigma", "x.x3f");
+        assertTypeByName("image/x-tika-epson", "x.erf");
+        assertTypeByName("image/x-tika-mamiya", "x.mef");
+        assertTypeByName("image/x-tika-leaf", "x.mos");
+        assertTypeByName("image/x-tika-panasonic", "x.raw");
+        assertTypeByName("image/x-tika-panasonic", "x.rw2");
+        assertTypeByName("image/x-tika-phaseone", "x.cap");
+        assertTypeByName("image/x-tika-phaseone", "x.iiq");
+        assertTypeByName("image/x-tika-phaseone", "x.cap");
+        assertTypeByName("image/x-tika-red", "x.r3d");
+        assertTypeByName("image/x-tika-imacon", "x.fff");
+        assertTypeByName("image/x-tika-logitech", "x.pxn");
+        assertTypeByName("image/x-tika-casio", "x.bay");
+        assertTypeByName("image/x-tika-rawzor", "x.rwz");
+    }
+
     /**
      * Tests MimeTypes.getMimeType(URL), which examines both the byte header
      * and, if necessary, the URL's extension.


Reply via email to