Hello

I somehow doesn't get my java application to recognise the mimetype
"image/jpx", it always gets recognised as "image/jpm" by Tika.

Simple Code:

final InputStream resourceAsStream1 =
ClassLoaderUtils.getResourceAsStream("jpx.jpf", Tika.class);
final BodyContentHandler handler = new BodyContentHandler();
final Metadata metadata = new Metadata();
final AutoDetectParser autoDetectParser = new AutoDetectParser();
try {
    autoDetectParser.parse(resourceAsStream1, handler, metadata);
} catch (IOException | TikaException | SAXException e) {
    throw new RuntimeException(e);
}

metadata:
X-TIKA: Parsed-By: EmptyParser
X-TIKA: Parsed-By-Full-Set: EmptyParser
Content-Type: image/jpm

Only dependency:

<dependency>
    <groupId>org.apache.tika</groupId>
    <artifactId>tika-core</artifactId>
    <version>2.4.0</version>
</dependency>


I've thrown the same file against "tika-app-2.4.0.jar" and they both give
the correct Content-Type.
Content-Type: image/jpx
X-TIKA:Parsed-By: org.apache.tika.parser.EmptyParser
X-TIKA:Parsed-By-Full-Set: org.apache.tika.parser.EmptyParser
resourceName: jpx.jpf

Are there some parsers that I need to configure additionally, so that the
correct Mimetype is recognised in my code?

Regards
Peter

Reply via email to