Should have looked at your code more closely earlier. The difference btwn the app and your code is that the app adds the filename to the metadata object. The detector does byte detection and then sees if the file extension can help refine the file type further.
Add this to your metadata object before the detection and you should be good: metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, path.getFileName().toString()); On Fri, Jun 3, 2022 at 5:22 PM Peter Maier <[email protected]> wrote: > I mean yes, they are hard to distinguish, but somehow the > "tika-app-2.4.0.jar" is able to do so, therefore I'm questioning if there > is something that it does different to what I try. > > Am Fr., 3. Juni 2022 um 10:27 Uhr schrieb Tilman Hausherr < > [email protected]>: > >> Tricky >> >> https://www.iana.org/assignments/media-types/image/jpx >> >> https://www.iana.org/assignments/media-types/image/jpm >> >>
