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

Hudson commented on TIKA-1085:
------------------------------

SUCCESS: Integrated in tika-trunk-jdk1.7 #697 (See 
[https://builds.apache.org/job/tika-trunk-jdk1.7/697/])
TIKA-1085 Treat a PDF with a leading Byte Order Mark the same for detection, 
and add low-priorty matches for the PDF magic coming in 1-1024 bytes of the 
start (may give false positives if too high), plus tests (nick: 
http://svn.apache.org/viewvc/tika/trunk/?view=rev&rev=1680957)
* 
/tika/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
* /tika/trunk/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java
* 
/tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java
* /tika/trunk/tika-parsers/src/test/resources/test-documents/testPDF_bom.pdf


> PDF header and mime detection
> -----------------------------
>
>                 Key: TIKA-1085
>                 URL: https://issues.apache.org/jira/browse/TIKA-1085
>             Project: Tika
>          Issue Type: Improvement
>          Components: mime
>    Affects Versions: 1.3
>            Reporter: Marco Quaranta
>            Priority: Minor
>              Labels: detection, header, mime, pdf
>         Attachments: hello-world-bom.pdf, hello-world.pdf, test.pdf
>
>
> I've found some PDF files Tika recognizes as application/octet-stream.
> These files differs from regularly identified PDF having a different header: 
> the %PDF-N.n string isn't at the beginning (zero offset) of the file but in 
> the first 1024 bytes.
> PDF reference states that "The first line of a PDF file shall be a header 
> consisting of the 5 characters  %PDF–  followed by a version 
> number of the form 1.N, where N is a digit between 0 and 7" 
> (http://tinyurl.com/8vnzm3c "p. 7.5.2 File Header"). 
> Looking further at implementation notes by Adobe (http://tinyurl.com/cbqpb24 
> p. 3.4.1 File Header) I've discover that: "Acrobat viewers require only that 
> the header appear somewhere within the first 1024 bytes of the file"
> What do you think about a PDF magic match with an offset 0:1024?
> <match value="%PDF-" type="string" offset="0:1024"/>
> Thank you,
> Marco



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to