You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Arjohn Kampman (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/11/17 15:38:51 UTC

[jira] [Issue Comment Edited] (TIKA-782) Add support for parsing binary data in RTF files

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

Arjohn Kampman edited comment on TIKA-782 at 11/17/11 2:36 PM:
---------------------------------------------------------------

I'll make the necessary changes.

Do you mind if I changed the <long> parameter of processControlWord() to an <int>.There's a comment above that method that says:

{quote}
// Param is long because spec says max value is 1+ Integer.MAX_VALUE!
{quote}

However, Microsoft's RTF 1.9.1 specs says:

{quote}
The range of the values for the number is nominally -32768 through 32767, i.e., a signed 16-bit integer. A small number of control words take values in the range‌ −2,147,483,648 to 2,147,483,647 (32-bit signed integer).
{quote}

This is exactly the range of Java's int. Not sure which spec the comment is referring to though.

                
      was (Author: arjohn):
    I'll make the necessary changes.

Do you mind if I changed the <long> parameter of processControlWord() to an <int>.There's a comment above that method that says:

    // Param is long because spec says max value is 1+ Integer.MAX_VALUE!

However, Microsoft's RTF 1.9.1 specs says:

    The range of the values for the number is nominally -32768 through 32767,
    i.e., a signed 16-bit integer. A small number of control words take values
    in the range‌ −2,147,483,648 to 2,147,483,647 (32-bit signed integer).

This is exactly the range of Java's int. Not sure which spec the comment is referring to though.

                  
> Add support for parsing binary data in RTF files
> ------------------------------------------------
>
>                 Key: TIKA-782
>                 URL: https://issues.apache.org/jira/browse/TIKA-782
>             Project: Tika
>          Issue Type: Improvement
>          Components: parser
>    Affects Versions: 1.0
>            Reporter: Arjohn Kampman
>            Assignee: Michael McCandless
>         Attachments: bin.patch, bin2.patch
>
>
> The current RTF parser doesn't process \bin control words yet. These control words are followed by a specific amount of binary data. Because of this, the RTF parser trips over some of these bytes in a number of (classified) documents.
> I've implemented processing of the \bin control word, but it required of the core parsing algorithm. IMHO, it also improved readability of the code. I hope you will accept this patch. Please let me know if the patch requires modifications.
> Apart from the \bin code word, this patch also makes the parser stop after reading the document-closing '}' character. In a number of files (again, classified), the parser would include non-readable characters that appeared after this closing brace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira