[ https://issues.apache.org/jira/browse/TIKA-1565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tyler Palsulich resolved TIKA-1565. ----------------------------------- Resolution: Fixed Fix Version/s: (was: 1.7) 1.8 Assignee: Tyler Palsulich Marking as Fixed for 1.8. The file is now parsed without an Exception. Please reopen if you are still running into this issue with Trunk or 1.8 (when it is released some time in the future). > image/gif parse error > --------------------- > > Key: TIKA-1565 > URL: https://issues.apache.org/jira/browse/TIKA-1565 > Project: Tika > Issue Type: Bug > Components: parser > Affects Versions: 1.7 > Environment: win7 x64 jdk1.7 > Reporter: lixin > Assignee: Tyler Palsulich > Fix For: 1.8 > > Attachments: JNK16-1309-173.mht > > > I am getting an exception parsing the following mht File > {code} > org.apache.tika.exception.TikaException: image/gif parse error > at org.apache.tika.parser.image.ImageParser.parse(ImageParser.java:115) > at > org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:239) > at > org.apache.tika.parser.mail.MailContentHandler.body(MailContentHandler.java:102) > at > org.apache.james.mime4j.parser.MimeStreamParser.parse(MimeStreamParser.java:133) > at org.apache.tika.parser.mail.RFC822Parser.parse(RFC822Parser.java:76) > at > org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:239) > at > org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:239) > at > org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:105) > at org.apache.tika.example.MyTest.test1(MyTest.java:31) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) > at > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) > at > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) > at org.junit.runners.ParentRunner.run(ParentRunner.java:300) > at > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) > Caused by: javax.imageio.IIOException: Unexpected block type 1! > at com.sun.imageio.plugins.gif.GIFImageReader.readMetadata(Unknown > Source) > at com.sun.imageio.plugins.gif.GIFImageReader.getWidth(Unknown Source) > at org.apache.tika.parser.image.ImageParser.parse(ImageParser.java:92) > ... 32 more > {code} > my test code: > {code} > AutoDetectParser parser = new AutoDetectParser(); > BodyContentHandler handler = new BodyContentHandler(); > Metadata metadata = new Metadata(); > ParseContext context = new ParseContext(); > parser.parse(new FileInputStream(new File(file)), handler, > metadata,context); > System.out.println(handler.toString()); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)