You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2012/08/28 13:50:09 UTC

[jira] [Created] (TIKA-984) JpegParserTest fails for some locales

Oliver Heger created TIKA-984:
---------------------------------

             Summary: JpegParserTest fails for some locales
                 Key: TIKA-984
                 URL: https://issues.apache.org/jira/browse/TIKA-984
             Project: Tika
          Issue Type: Bug
          Components: parser
    Affects Versions: 1.2
            Reporter: Oliver Heger
            Priority: Minor


On a German locale I get the following test failures:
Failed tests:
testJPEGGeo(org.apache.tika.parser.jpeg.JpegParserTest): expected:<12[.]54321> but was:<12[,]54321>
  testJPEGGeo2(org.apache.tika.parser.jpeg.JpegParserTest): expected:<51[.]575762> but was:<51[,]575762>

I can provide a patch to make the test pass, but I wonder whether it is desired that the output depends on the locale. This makes it harder for client applications to evaluate parsing results.

The cause of the problem seems to be the field {{GEO_DECIMAL_FORMAT}} in class {{ImageMetadataExtractor}}. The formatted strings produced by this object are locale-dependent.

--
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

[jira] [Resolved] (TIKA-984) JpegParserTest fails for some locales

Posted by "Ray Gauss II (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ray Gauss II resolved TIKA-984.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3

Fixed in 1403139.

I changed slightly from Oliver's patch, leaving a {{String}} constant defining the format in place but creating a new locale-specific {{DecimalFormat}} object in the handler.

Thanks for spotting this and the patch!
                
> JpegParserTest fails for some locales
> -------------------------------------
>
>                 Key: TIKA-984
>                 URL: https://issues.apache.org/jira/browse/TIKA-984
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.2
>            Reporter: Oliver Heger
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: TIKA-984.patch
>
>
> On a German locale I get the following test failures:
> Failed tests:
> testJPEGGeo(org.apache.tika.parser.jpeg.JpegParserTest): expected:<12[.]54321> but was:<12[,]54321>
>   testJPEGGeo2(org.apache.tika.parser.jpeg.JpegParserTest): expected:<51[.]575762> but was:<51[,]575762>
> I can provide a patch to make the test pass, but I wonder whether it is desired that the output depends on the locale. This makes it harder for client applications to evaluate parsing results.
> The cause of the problem seems to be the field {{GEO_DECIMAL_FORMAT}} in class {{ImageMetadataExtractor}}. The formatted strings produced by this object are locale-dependent.

--
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

[jira] [Updated] (TIKA-984) JpegParserTest fails for some locales

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TIKA-984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger updated TIKA-984:
------------------------------

    Attachment: TIKA-984.patch

Proposed patch for {{ImageMetaDataExtractor}}:

The {{DecimalFormat}} is now always created with an English locale. This guarantees a predictable output.

I also removed the *static final* member field {{GEO_DECIMAL_FORMAT}}. This was problematic because {{DecimalFormat}} is not thread-safe. A new instance is now always created if formatting is done.
                
> JpegParserTest fails for some locales
> -------------------------------------
>
>                 Key: TIKA-984
>                 URL: https://issues.apache.org/jira/browse/TIKA-984
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.2
>            Reporter: Oliver Heger
>            Priority: Minor
>         Attachments: TIKA-984.patch
>
>
> On a German locale I get the following test failures:
> Failed tests:
> testJPEGGeo(org.apache.tika.parser.jpeg.JpegParserTest): expected:<12[.]54321> but was:<12[,]54321>
>   testJPEGGeo2(org.apache.tika.parser.jpeg.JpegParserTest): expected:<51[.]575762> but was:<51[,]575762>
> I can provide a patch to make the test pass, but I wonder whether it is desired that the output depends on the locale. This makes it harder for client applications to evaluate parsing results.
> The cause of the problem seems to be the field {{GEO_DECIMAL_FORMAT}} in class {{ImageMetadataExtractor}}. The formatted strings produced by this object are locale-dependent.

--
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