Skip to content

Commit 5323f9e

Browse files
committed
TIKA-4037 -- add detection for os2 bitmap arrays.
1 parent 92fb29e commit 5323f9e

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5642,8 +5642,21 @@
56425642
<match value="0x762F310102040000" type="string" offset="0"/>
56435643
</magic>
56445644
<glob pattern="*.exr"/>
5645-
</mime-type>
5645+
</mime-type>
56465646

5647+
<mime-type type="image/x-os2-graphics; charset=binary">
5648+
<_comment>OS2 bitmap array</_comment>
5649+
<tika:link>http://fileformats.archiveteam.org/wiki/OS/2_Bitmap_Array</tika:link>
5650+
<magic priority="50">
5651+
<match value="BA" type="string" offset="0">
5652+
<match value="BM" type="string" offset="14"/>
5653+
<match value="CI" type="string" offset="14"/>
5654+
<match value="IC" type="string" offset="14"/>
5655+
<match value="CP" type="string" offset="14"/>
5656+
<match value="PT" type="string" offset="14"/>
5657+
</match>
5658+
</magic>
5659+
</mime-type>
56475660
<mime-type type="image/bmp">
56485661
<alias type="image/x-bmp"/>
56495662
<alias type="image/x-ms-bmp"/>

tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ public void testBmpDetection() throws Exception {
571571
assertType("text/plain", "testBMPfp.txt");
572572
}
573573

574+
@Test
575+
public void testOS2BitmapArray() throws Exception {
576+
assertTypeByData("image/x-os2-graphics; charset=binary", "testOS2BitmapArray");
577+
}
578+
574579
@Test
575580
public void testPnmDetection() throws Exception {
576581
assertType("image/x-portable-bitmap", "testPBM.pbm");

0 commit comments

Comments
 (0)