Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-3487

Timezones inappropriately set to GMT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.27
    • None
    • metadata
    • None

    Description

      The code in ImageMetadataExtractor.handleDateTags does not correctly handle Exif timestamps. While the notes in the code are correct about how the timestamps should be handled, the code is not behaving as expected because Directory.getDate has already inappropriately modified the timestamps to be in GMT. So, instead of writing the timestamp out as it was originally recorded, it's being written out in GMT.

      For example, I have an image with a Created Date of "2010:07:07 14:22:53". Tika displays this as: <meta name="Creation-Date" content="2010-07-07T09:22:53"/>

      This happens because the SimpleDateObject in ImageMetadataExtractor that formats the date is using my local timezone, which is in Central; while the Date object is in GMT.

      I considered filing this issue against the metadata-extractor library, but did not because I was unsure if there were some instances where this behavior is appropriate and it is clearly documented in the API.

      A possible solution for Tike would be simply to not use metadata-extractor to parse the date, and handle the parse logic internally.

      See page 33 of this resource for a thorough description of how these fields are supposed to be handled.

      Attachments

        Activity

          People

            Unassigned Unassigned
            pwinckles Peter Winckles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: