sortphotos icon indicating copy to clipboard operation
sortphotos copied to clipboard

Bug when an exif data is of type "HH:MM:SS" like "18:07:03"

Open nekopep opened this issue 9 years ago • 0 comments

Hello, While finishing my branch work I discovered a little bug with one photo. One exif tag was of type: "HH:MM:SS" -> "18:07:03" and parse_date_exif processed it as a YEAR:MONTH:DAY

I patched it as is:

#check if three entries, nonzero data, and no decimal (which occurs for timestamps with only time but no date), and len year = 4 to workaround 'HH:MM:SS' entries
    if len(date_entries) == 3 and date_entries[0] > '0000' and '.' not in ''.join(date_entries) and len(date_entries[0]) == 4:
        year = int(date_entries[0])
        month = int(date_entries[1])
        day = int(date_entries[2])
    else:
        return None

(you can find the patch in my fork/pull request)

nekopep avatar Sep 19 '15 01:09 nekopep