tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joël Royer (JIRA) <j...@apache.org>
Subject [jira] [Updated] (TIKA-1164) InputStream get modified by content type detection
Date Mon, 19 Aug 2013 15:06:48 GMT

     [ https://issues.apache.org/jira/browse/TIKA-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joël Royer updated TIKA-1164:
-----------------------------

    Description: 
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.

  was:
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, nom);
md.add(Metadata.CONTENT_TYPE, typeMime);
MediaType type = detector.detect(new BufferedInputStream(is), md);
{code}

Before detection, file size is correct.
After detection, file size is lower than original.

    
> 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

Mime
View raw message