Skip to content

Commit 3c600a1

Browse files
committed
TIKA-4511 -- detected compressed bmp (#2361)
(cherry picked from commit 616c35f)
1 parent 0f49ffe commit 3c600a1

2 files changed

Lines changed: 38 additions & 8 deletions

File tree

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Release 3.3.0 - ???
22

3+
* Add detection of compressed bmp (TIKA-4511).
4+
35
* Allow per file timeouts in tika-pipes (TIKA-4497).
46

57
* Add matroska detector (TIKA-1180).

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

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6380,20 +6380,48 @@
63806380
<magic priority="50">
63816381
<match value="BM" type="string" offset="0">
63826382
<match value="0x0100" type="string" offset="26">
6383-
<match value="0x0000" type="string" offset="28"/>
6384-
<match value="0x0100" type="string" offset="28"/>
6385-
<match value="0x0400" type="string" offset="28"/>
6386-
<match value="0x0800" type="string" offset="28"/>
6387-
<match value="0x1000" type="string" offset="28"/>
6388-
<match value="0x1800" type="string" offset="28"/>
6389-
<match value="0x2000" type="string" offset="28"/>
6383+
<match minShouldMatch="2">
6384+
<match minShouldMatch="1">
6385+
<match value="0x0000" type="string" offset="28"/>
6386+
<match value="0x0100" type="string" offset="28"/>
6387+
<match value="0x0400" type="string" offset="28"/>
6388+
<match value="0x0800" type="string" offset="28"/>
6389+
<match value="0x1000" type="string" offset="28"/>
6390+
<match value="0x1800" type="string" offset="28"/>
6391+
<match value="0x2000" type="string" offset="28"/>
6392+
</match>
6393+
<match value="0x00000000" type="string" offset="30"/>
6394+
</match>
63906395
</match>
63916396
</match>
63926397
</magic>
63936398
<glob pattern="*.bmp"/>
63946399
<glob pattern="*.dib"/>
63956400
</mime-type>
6396-
6401+
<mime-type type="image/bmp;format=compressed">
6402+
<acronym>BMP</acronym>
6403+
<_comment>Windows bitmap compressed</_comment>
6404+
<tika:link>http://en.wikipedia.org/wiki/BMP_file_format</tika:link>
6405+
<tika:uti>com.microsoft.bmp</tika:uti>
6406+
<!-- detection could be based on a non-zero value at offset=30.
6407+
current strategy is to determine uncompressed if value is zero
6408+
at a lower priority.
6409+
-->
6410+
<magic priority="45">
6411+
<match value="BM" type="string" offset="0">
6412+
<match value="0x0100" type="string" offset="26">
6413+
<match value="0x0000" type="string" offset="28"/>
6414+
<match value="0x0100" type="string" offset="28"/>
6415+
<match value="0x0400" type="string" offset="28"/>
6416+
<match value="0x0800" type="string" offset="28"/>
6417+
<match value="0x1000" type="string" offset="28"/>
6418+
<match value="0x1800" type="string" offset="28"/>
6419+
<match value="0x2000" type="string" offset="28"/>
6420+
</match>
6421+
</match>
6422+
</magic>
6423+
<sub-class-of type="image/bmp"/>
6424+
</mime-type>
63976425
<mime-type type="image/x-bpg">
63986426
<acronym>BPG</acronym>
63996427
<_comment>Better Portable Graphics</_comment>

0 commit comments

Comments
 (0)