You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Boris Naguet (JIRA)" <ji...@apache.org> on 2013/10/01 11:53:23 UTC

[jira] [Commented] (TIKA-1175) MS Money files wrongly detected as True Type Font

    [ https://issues.apache.org/jira/browse/TIKA-1175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13782767#comment-13782767 ] 

Boris Naguet commented on TIKA-1175:
------------------------------------

Similar issues on files being detected as TTF files due to permissive magic detection.

> MS Money files wrongly detected as True Type Font
> -------------------------------------------------
>
>                 Key: TIKA-1175
>                 URL: https://issues.apache.org/jira/browse/TIKA-1175
>             Project: Tika
>          Issue Type: Bug
>          Components: mime
>    Affects Versions: 1.3, 1.4
>            Reporter: Boris Naguet
>            Priority: Minor
>
> TTF magic is probably not specific enough, because it incorrectly detect MS Money files as TTF files, and then the parsing generates an Exception.
> {quote}
> Caused by: ! java.io.IOException: head is mandatory
> ! at org.apache.fontbox.ttf.AbstractTTFParser.parseTables(AbstractTTFParser.java:107) 
> {quote}
> Here is the magic detection code that I added to {{custom-mimetypes.xml}}, and solves it:
> {code:xml}
> <mime-info>
> 	<mime-type type="application/x-msmoney">
> 		<glob pattern="*.mny" />
> 		<magic priority="60">
> 			<match value="0x000100004D534953414D204461746162617365" type="string" offset="0" />
> 		</magic>
> 	</mime-type>
> {code}
> It can replace the existing {{application/x-msmoney}} empty mime-type in {{tika-mimetypes.xml}}.
> magic comes from
> http://filesignatures.net/index.php?search=mny&mode=EXT



--
This message was sent by Atlassian JIRA
(v6.1#6144)