Author Topic: Q: How is the hash in .pmingest.dat calculated?  (Read 2261 times)

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Q: How is the hash in .pmingest.dat calculated?
« on: April 28, 2021, 11:53:10 PM »
When the you switch from summer to winter (or vice versa), the file dates of existing images on a memory card get shifted too (because FAT does not record timezone info). This is annoying, but to make matter worse, this also breaks the incremental ingest. Which can no longer determine it already processed some of the files on the card.

The content of the .pmingest.dat file that drives this looks like a simple hash, so I was wondering if I could not recalculate it myself and have incremental ingest work again (the best solution, of course, would be to have PM to be unaffected by the timeshift, but that's for later I think).
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Q: How is the hash in .pmingest.dat calculated?
« Reply #1 on: April 29, 2021, 09:12:25 AM »
Hayo,

When the you switch from summer to winter (or vice versa), the file dates of existing images on a memory card get shifted too (because FAT does not record timezone info). This is annoying, but to make matter worse, this also breaks the incremental ingest. Which can no longer determine it already processed some of the files on the card.

The content of the .pmingest.dat file that drives this looks like a simple hash, so I was wondering if I could not recalculate it myself and have incremental ingest work again (the best solution, of course, would be to have PM to be unaffected by the timeshift, but that's for later I think).

The .pmingest.dat file contains a GUID, which we use to identify a disk.  The GUID is used to name a file in the following location on macOS:

~/Library/Caches/Photo Mechanic/ingest/incremental/

The file is a simple tab-separated value text file containing the path to the files ingested, their file size, and the modification time from the filesystem the files were stored on.

You could update the modification time values to account for the offset with a script.

HTH,

-Kirk

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Q: How is the hash in .pmingest.dat calculated?
« Reply #2 on: April 29, 2021, 11:09:58 AM »
Awesome, thanks. Adjusting the time by one hour is pretty easy, I just need to subtract or add 3600 (seconds) to the third column 8)

Now to remember all this next time this happens ;)

(Would you consider taking care of summer/winter time changes automatically in a future release?)
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Q: How is the hash in .pmingest.dat calculated?
« Reply #3 on: April 29, 2021, 11:50:14 AM »
Hayo,

Awesome, thanks. Adjusting the time by one hour is pretty easy, I just need to subtract or add 3600 (seconds) to the third column 8)

Now to remember all this next time this happens ;)

(Would you consider taking care of summer/winter time changes automatically in a future release?)

Possibly.  I take it that you rarely format your cards in-camera?

-Kirk

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Q: How is the hash in .pmingest.dat calculated?
« Reply #4 on: April 29, 2021, 12:54:56 PM »
Possibly.  I take it that you rarely format your cards in-camera?

Actually I usually do, but I hadn't this time ::)

Interestingly, this is (only) the second time this happened to me, so not a real big problem (and this time I was prepared it could happen as well).
Hayo Baan - Photography
Web: www.hayobaan.nl