[ 
https://issues.apache.org/jira/browse/TIKA-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13780105#comment-13780105
 ] 

Kevin Slote commented on TIKA-1164:
-----------------------------------

I recently joined this page to report this same bug.  I encountered this the 
other day.  If I applied the detect(InputStream in) method.  It erased the 
InputStream.  
                
> InputStream get modified by content type detection
> --------------------------------------------------
>
>                 Key: TIKA-1164
>                 URL: https://issues.apache.org/jira/browse/TIKA-1164
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: Windows 7 / Eclipse Kepler / Tomcat 7 / JavaSE 7
>            Reporter: Joël Royer
>            Priority: Blocker
>
> I'm using Tika for content type detection after file upload.
> After tika detection, file content is modified (not the same size compared to 
> original uploaded file).
> Here is my code:
> {code}
> AutoDetectParser parser = new AutoDetectParser();
> Detector detector = parser.getDetector();
> Metadata md = new Metadata();
> md.add(Metadata.RESOURCE_NAME_KEY, uploadedFilename);
> md.add(Metadata.CONTENT_TYPE, uploadedFileContentType);
> MediaType type = detector.detect(new BufferedInputStream(is), md);
> {code}
> Before detection, file size is correct.
> After detection, file size is lower than original.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to