sortphotos icon indicating copy to clipboard operation
sortphotos copied to clipboard

wrong date recognition

Open philsynek opened this issue 3 years ago • 6 comments

Hi, unfortunately something seems to be wrong with the date recognition. At least in one case for me:

Preprocessing with ExifTool.  May take a while for a large number of files.
    3 directories scanned
    1 image files read
[{
  "SourceFile": "/mnt/bilder/12/05/07/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg",
  "File:FileModifyDate": "2020:03:08 11:05:07+00:00",
  "File:FileAccessDate": "2020:03:08 11:05:07+00:00",
  "File:FileInodeChangeDate": "2021:05:28 04:49:25+00:00",
  "EXIF:ModifyDate": "2020:03:08 12:05:07",
  "EXIF:DateTimeOriginal": "2020:03:08 12:05:07",
  "EXIF:CreateDate": "2020:03:08 12:05:07",
  "EXIF:OffsetTime": "+01:00",
  "EXIF:OffsetTimeOriginal": "+01:00",
  "EXIF:OffsetTimeDigitized": "+01:00",
  "EXIF:SubSecTimeOriginal": 547,
  "EXIF:SubSecTimeDigitized": 547,
  "IPTC:DigitalCreationTime": "12:05:07",
  "IPTC:DigitalCreationDate": "2020:03:08",
  "IPTC:DateCreated": "2020:03:08",
  "IPTC:TimeCreated": "12:05:07",
  "Composite:DateTimeCreated": "2020:03:08 12:05:07",
  "Composite:DigitalCreationDateTime": "2020:03:08 12:05:07",
  "Composite:SubSecCreateDate": "2020:03:08 12:05:07.547+01:00",
  "Composite:SubSecDateTimeOriginal": "2020:03:08 12:05:07.547+01:00",
  "Composite:SubSecModifyDate": "2020:03:08 12:05:07+01:00"
}]
{ready}

[1/1]
Source: /mnt/bilder/12/05/07/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg
Date/Time: 0012-05-07 12:00:00
Corresponding Tags: IPTC:DigitalCreationTime, IPTC:TimeCreated
Destination (move): /mnt/bilder/12/05/07/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg
Identical file already exists.  Duplicate will be ignored.

I am very certain, that this picture wasn't taken in the year 12... ;)

Cheers, Phil

philsynek avatar May 28 '21 10:05 philsynek

Hey @philsynek,

can you post the exect command you used to execute sortphotos? As 12:05:07 is the time the picture was taken, maybe you are using a wrong --sort pattern?

matthiasbalke avatar Jul 07 '21 10:07 matthiasbalke

Hey Matthias, thanks for the reply! Here you go:

phil@librephotos:~$ sudo python3 sortphotos/src/sortphotos.py -r -t --sort %Y/%m/%d /mnt/import/test /mnt/bilder/ Preprocessing with ExifTool. May take a while for a large number of files. 1 directories scanned 1 image files read [{ "SourceFile": "/mnt/import/test/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg", "File:FileModifyDate": "2020:03:08 12:05:07+01:00", "File:FileAccessDate": "2021:07:07 13:02:20+02:00", "File:FileInodeChangeDate": "2021:07:07 13:02:20+02:00", "EXIF:ModifyDate": "2020:03:08 12:05:07", "EXIF:DateTimeOriginal": "2020:03:08 12:05:07", "EXIF:CreateDate": "2020:03:08 12:05:07", "EXIF:OffsetTime": "+01:00", "EXIF:OffsetTimeOriginal": "+01:00", "EXIF:OffsetTimeDigitized": "+01:00", "EXIF:SubSecTimeOriginal": 547, "EXIF:SubSecTimeDigitized": 547, "IPTC:DigitalCreationTime": "12:05:07", "IPTC:DigitalCreationDate": "2020:03:08", "IPTC:DateCreated": "2020:03:08", "IPTC:TimeCreated": "12:05:07", "Composite:DateTimeCreated": "2020:03:08 12:05:07", "Composite:DigitalCreationDateTime": "2020:03:08 12:05:07", "Composite:SubSecCreateDate": "2020:03:08 12:05:07.547+01:00", "Composite:SubSecDateTimeOriginal": "2020:03:08 12:05:07.547+01:00", "Composite:SubSecModifyDate": "2020:03:08 12:05:07+01:00" }] {ready}

[1/1] (TEST - no files are being moved/copied) Source: /mnt/import/test/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg Date/Time: 0012-05-07 12:00:00 Corresponding Tags: IPTC:DigitalCreationTime, IPTC:TimeCreated Destination (move): /mnt/bilder/12/05/07/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg

philsynek avatar Jul 07 '21 11:07 philsynek

Yeah you seem right, that sortphotos is having a bug here. It also tells us that it's using the time fields here: Corresponding Tags: IPTC:DigitalCreationTime, IPTC:TimeCreated

As a workaround you could try excluding these tags explicitly.

matthiasbalke avatar Jul 07 '21 11:07 matthiasbalke

Thank you, Matthias! The workaround is working:

phil@librephotos:~$ sudo python3 sortphotos/src/sortphotos.py -r -t --ignore-tags IPTC:TimeCreated IPTC:DigitalCreationTime --sort %Y/%m/%d /mnt/import/test /mnt/bilder/ Preprocessing with ExifTool. May take a while for a large number of files. 1 directories scanned 1 image files read [{ "SourceFile": "/mnt/import/test/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg", "File:FileModifyDate": "2020:03:08 12:05:07+01:00", "File:FileAccessDate": "2021:07:07 13:02:20+02:00", "File:FileInodeChangeDate": "2021:07:07 13:02:20+02:00", "EXIF:ModifyDate": "2020:03:08 12:05:07", "EXIF:DateTimeOriginal": "2020:03:08 12:05:07", "EXIF:CreateDate": "2020:03:08 12:05:07", "EXIF:OffsetTime": "+01:00", "EXIF:OffsetTimeOriginal": "+01:00", "EXIF:OffsetTimeDigitized": "+01:00", "EXIF:SubSecTimeOriginal": 547, "EXIF:SubSecTimeDigitized": 547, "IPTC:DigitalCreationTime": "12:05:07", "IPTC:DigitalCreationDate": "2020:03:08", "IPTC:DateCreated": "2020:03:08", "IPTC:TimeCreated": "12:05:07", "Composite:DateTimeCreated": "2020:03:08 12:05:07", "Composite:DigitalCreationDateTime": "2020:03:08 12:05:07", "Composite:SubSecCreateDate": "2020:03:08 12:05:07.547+01:00", "Composite:SubSecDateTimeOriginal": "2020:03:08 12:05:07.547+01:00", "Composite:SubSecModifyDate": "2020:03:08 12:05:07+01:00" }] {ready}

[1/1] (TEST - no files are being moved/copied) Source: /mnt/import/test/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg Date/Time: 2020-03-08 11:05:07 Corresponding Tags: File:FileModifyDate, Composite:SubSecCreateDate, Composite:SubSecDateTimeOriginal, Composite:SubSecModifyDate Destination (move): /mnt/bilder/2020/03/08/CF96FFFE-51B0-42EE-98F2-69A34137DAB1.jpg

philsynek avatar Jul 07 '21 11:07 philsynek

@philsynek glad I could help you out. Still seems to be a mysterious bug.

matthiasbalke avatar Jul 08 '21 20:07 matthiasbalke

I followed your fix @matthiasbalke and that worked for me too. Thanks!

reidcooper avatar Aug 16 '22 17:08 reidcooper