You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Nick Burch (JIRA)" <ji...@apache.org> on 2015/10/05 19:23:26 UTC

[jira] [Commented] (TIKA-1763) StringIndexOutOfBoundsException in ImageMetadataExtractor

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

Nick Burch commented on TIKA-1763:
----------------------------------

Do you have a small test file you could share which shows the problem? I believe that there always ought to be the "pixels" string in the response, so would be good to find out what's happening if you've found it doesn't always

> StringIndexOutOfBoundsException in ImageMetadataExtractor
> ---------------------------------------------------------
>
>                 Key: TIKA-1763
>                 URL: https://issues.apache.org/jira/browse/TIKA-1763
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.10
>            Reporter: Joseph North
>            Priority: Minor
>
> The {{trimPixels(String s)}} method in {{ImageMetadataExtractor}} will throw a {{StringIndexOutOfBoundsException}} if the string passed to it doesn't contain the substring " pixels". The method does a {{lastIndexOf(" pixels")}} call on the string passed to it and uses the result directly in a {{substring()}} call without checking whether the result is greater than -1.



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