Closed BigCheeZ closed 1 year ago
@BigCheeZ, as you mentioned #208 is tackling the same issue but I think the implementation there is better and unfortunatelly I'll close your PR but thank you for the effort! Further PRs are welcome!
This note is just for posterity. The logic in this PR was not enough to work for my needs. The reason being that sometimes the date with timezone information was not accurate. I had some older images where the correct time was recorded, but the timezone was not recorded in the date. The file modified date was much newer (it was the current date when I exported the image) and since it did have the timezone information, my branch of the code was incorrectly choosing that file-modification date instead of the actual date when the image was captured.
I changed the logic in selecting a date string to prefer a date with time zone information. I did this to support my use case which includes Apple Live Photos. I use the 'boredazfcuk/icloudpd' docker image for downloading my images from iCloud. I want to use phockup to reorganize them since I decided to change my organization scheme. An issue I noticed is that the picture and video portions of a live photo have different keys and info in the keys. In particular, the video file exif data appears to use UTC time except for a single field. That field is 'Creation Date'. The video also has 'Create Date' but it is UTC time. This has lead to phockup putting the picture file in one date directory and the video in another for Live Photos when the UTC time is on a different date than the time zone set for the phone.
Example snippets.
Live Photo picture portion (eg: img0.HEIC):
Live Photo video portion (eg: img0_HEVC.MOV).
I see there is another PR that may be trying to solve this problem in a different way.
https://github.com/ivandokov/phockup/pull/208