[ https://issues.apache.org/jira/browse/TIKA-3065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17054863#comment-17054863 ]
Tilman Hausherr commented on TIKA-3065: --------------------------------------- works for me: {code} public class TIKA3065 { public static void main(String[] args) throws MalformedURLException, IOException, MimeTypeException { TikaInputStream tis = TikaInputStream.get(new URL("https://issues.apache.org/jira/secure/attachment/12996133/2.pdf").openStream()); String mediaType = new Tika().detect(tis, "2.pdf"); MimeType extension = MimeTypes.getDefaultMimeTypes().forName(mediaType); System.out.println(extension); } } {code} output: {noformat} SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Mär 09, 2020 12:30:01 PM org.apache.tika.config.InitializableProblemHandler$3 handleInitializableProblem WARNUNG: J2KImageReader not loaded. JPEG2000 files will not be processed. See https://pdfbox.apache.org/2.0/dependencies.html#jai-image-io for optional dependencies. Mär 09, 2020 12:30:01 PM org.apache.tika.config.InitializableProblemHandler$3 handleInitializableProblem WARNUNG: org.xerial's sqlite-jdbc is not loaded. Please provide the jar on your classpath to parse sqlite files. See tika-parsers/pom.xml for the correct version. application/pdf {noformat} > Not able to parse the document with inline image > ------------------------------------------------ > > Key: TIKA-3065 > URL: https://issues.apache.org/jira/browse/TIKA-3065 > Project: Tika > Issue Type: Bug > Affects Versions: 1.23 > Reporter: suchendra > Priority: Major > Attachments: 2.pdf > > > I am using apache tika in my project to detect the file extension. I am using > Scala for development. > Below is the code, > {code:java} > // code placeholder > val sinkIs = StreamConverters.asInputStream(60 seconds) > val is = data.runWith(sinkIs) > val tikaStream = TikaInputStream.get(is) > val mediaType = new Tika().detect(tikaStream, fileName) > val extension = MimeTypes.getDefaultMimeTypes.forName(mediaType) > print("extension: " + extension.getExtension) > {code} > I have a API which upload the files and gives back the extension as response. > I have attached the file I used to upload. But I am facing the problem with > all types of doc which contains the image. Basically it stuck at > POICSContainerDetector's detect method. -- This message was sent by Atlassian Jira (v8.3.4#803005)