News for hackers. Stuff that matters.
Re:PhotoPrism: Browse Your Life in Pictures by buildbot on Tuesday July 11, 2023 @02:49PM (#36685550)
I went about depdup in a similar but opposite way then you did - https://github.com/mgolub2/photodb

I used libraw to read the actual raw data from my images, ignoring possible metadata that can get changed/updated by Capture One for example. The raw data is just fed into a hashing function, to get an exact content hash. Does not work if your image is down-sampled of course, but that was actually my goal - I want to know if the raw content has changed/bit flipped, but don't care if the metadata is altered or missing.

Re:PhotoPrism: Browse Your Life in Pictures by mceachen on Tuesday July 11, 2023 @02:59PM (#36685694)
Ah! In this case, you might be happy to discover that ExifTool just added an "image content" hash--it's the SHA (or MD5 or whatever) hash of the _actual image bytes_, after ignoring the metadata header (and possible footer) payloads.

So if you, say, change the rotation of your RAW image file (which normally will just add or change the EXIF `Orientation` tag), the image content hash will stay the same.

See https://exiftool.org/ExifTool.html#ImageHashType

(of course, your current approach should prove substantively faster, but will only work with the formats that libraw supports)

Re:PhotoPrism: Browse Your Life in Pictures by dcow on Tuesday July 11, 2023 @05:50PM (#36687716)
Why is GP's approach substantially faster?
Re:PhotoPrism: Browse Your Life in Pictures by mceachen on Tuesday July 11, 2023 @06:44PM (#36688241)
His tool is in rust, so he can directly call the libraw function. ExifTool is a perl tool, so it'd be an external process that he'd need to coordinate with.