osxphotos: Wrong metadata for TIFF modified date

Recently I found a bug (tested on version 0.36.0). Modify Date metadata in exported photos is incorrect – during export date is set on current date.

Problem exists for photos with .HEIC extension. There is photo f.ex. from 2018. Not edited, original. After export using osxphotos with --exiftool and --touch-file together, exported photo returns such metadata (using exiftool -a -G1 in terminal):

[System]        File Modification Date/Time     : 2018:08:17 20:33:43+02:00
[IFD0]          Modify Date                     : 2020:10:29 21:05:28
[ExifIFD]       Date/Time Original              : 2018:08:17 20:33:43
[ExifIFD]       Create Date                     : 2018:08:17 20:33:43
[Composite]     Create Date                     : 2018:08:17 20:33:43.289
[Composite]     Date/Time Original              : 2018:08:17 20:33:43.289+02:00

The same photo exported from Photos.app using built-in method returns following metadata in exiftool:

[System]        File Modification Date/Time     : 2018:08:17 20:33:43+02:00
[IFD0]          Modify Date                     : 2018:08:17 20:33:43
[ExifIFD]       Date/Time Original              : 2018:08:17 20:33:43
[ExifIFD]       Create Date                     : 2018:08:17 20:33:43
[Composite]     Create Date                     : 2018:08:17 20:33:43.289
[Composite]     Date/Time Original              : 2018:08:17 20:33:43.289

Easy to find there is difference in [IFD0] Modify Date. Also presented in Information window in Preview.app (tab TIFF).

Many software for photo managing use modify date to sort pictures, then everything starts to be a mess. Unfortunately I don’t have any clue how to solve above issue in the code. Let me know if I can provide more info.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (17 by maintainers)

Commits related to this issue

Most upvoted comments

@RhetTbull Thank you for improvements and sorry for delay in response.

It looks like now it’s working properly. Below I paste results:

[File]          File Modification Date/Time     : 2020:09:13 09:33:38+02:00
[File]          File Access Date/Time           : 2020:11:13 20:31:49+01:00
[File]          File Inode Change Date/Time     : 2020:11:13 20:31:48+01:00
[EXIF]          Modify Date                     : 2020:09:13 09:33:38
[EXIF]          Date/Time Original              : 2020:09:13 09:33:38
[EXIF]          Create Date                     : 2020:09:13 09:33:38
[XMP]           Date Created                    : 2020:09:13 09:33:38
[XMP]           Create Date                     : 2020:09:13 09:33:38
[XMP]           Modify Date                     : 2020:09:13 09:33:38
[IPTC]          Date Created                    : 2020:09:13
[ICC_Profile]   Profile Date Time               : 2017:07:07 13:22:32
[Composite]     Create Date                     : 2020:09:13 09:33:38.785
[Composite]     Date/Time Original              : 2020:09:13 09:33:38.785+02:00
[Composite]     Date/Time Created               : 2020:09:13 09:33:38+02:00