You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Konstantin (JIRA)" <ji...@apache.org> on 2014/11/20 19:50:33 UTC
[jira] [Closed] (TIKA-1485) Wrong mimetype detection
[ https://issues.apache.org/jira/browse/TIKA-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Konstantin closed TIKA-1485.
----------------------------
Resolution: Not a Problem
> Wrong mimetype detection
> ------------------------
>
> Key: TIKA-1485
> URL: https://issues.apache.org/jira/browse/TIKA-1485
> Project: Tika
> Issue Type: Bug
> Affects Versions: 1.5, 1.6
> Reporter: Konstantin
> Attachments: file.jpg, file_corrupted, file_corrupted.jpg, jpg_file
>
>
> [SCENARIO]
> # get a valid jpg (almost all file types that have a header are affected).
> # insert some whitespaces or line breaks in the beginning of file (it becomes invalid)
> # check file mimetype:
> {code}
> Metadata metadata = new Metadata();
> metadata.set(Metadata.RESOURCE_NAME_KEY, file.toString());
> MediaType mimetype = new TikaConfig().getDetector().detect(TikaInputStream.get(file), metadata);
> {code}
> [RESULT]
> detected mimetype is "image/jpeg"
> [EXPECTED]
> "application/octet-stream"
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)