You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use the Image-Data Hash for Duplicate Detection and the Immich Trash Match #278
Use the image-data hash, which the catalog now records per file (#274), so that duplicate detection and the Immich trash match survive a change that touches only metadata.
Problem
Import dedup and the trash match both compare whole-file hashes (SHA-256 for dedup, SHA-1 for trash). Two copies of one photo that differ only in metadata bytes therefore look like two different files:
A downloader that rewrites metadata, or a switch to a different downloader, makes every previously imported file look new, so it is imported again and becomes a duplicate in Immich.
An asset the owner removed in Immich is recorded in the trash database by the SHA-1 of the exact bytes Immich held. The same photo arriving again with different metadata bytes does not match, so the removed photo comes back.
Example with constructed names: IMG_1234.HEIC is imported and uploaded, then trashed in Immich. Later the source delivers IMG_1234.HEIC again with an extra XMP block. Its SHA-256 and SHA-1 differ, its image-data hash is identical, and today it is imported and uploaded a second time.
Proposal
Dedup: an opt-in import option that also skips a source file whose image-data hash is already known to the import database, and logs which known file it matched.
Trash: when an asset is recorded as trashed, also record the image-data hash of the processed file that was uploaded (looked up by its SHA-1 in the process database), and let import and process treat a file with a recorded image-data hash as trashed.
Keep the whole-file hash behaviour as the default until the option has been validated, since an image-data match is deliberately weaker than a byte match: two files with equal image data and different metadata are treated as one.
Notes
The image-data hash is absent for formats ExifTool cannot hash; those keep today's whole-file behaviour.
A re-encoded or edited rendition has different image data and is unaffected.
Released (2026-11-18):#288 merged to develop at 3731ff9, and its branch and worktree are cleaned up. The issue closes when the promotion to main lands.
Backlog burndown claim (2026-11-18, round 1 refill): group #278 on branch feature/image-hash-dedup-trash.
Maintainer's answer (2026-11-18, backlog burndown): merge #288 as is. After a duplicate cull, the trashed copy's image hash also matches the kept copy. process --imagehash then deletes the kept copy's processed file, and import --imagehash skips its source. That is the trade-off this issue accepted (equal image data counts as one file). It is opt-in and documented, so no safeguard is required first.
Activity
ptr727 commentedon Nov 18, 2026
Released (2026-11-18): #288 merged to develop at 3731ff9, and its branch and worktree are cleaned up. The issue closes when the promotion to main lands.
Backlog burndown claim (2026-11-18, round 1 refill): group #278 on branch
feature/image-hash-dedup-trash.Predicted files:
PhotoCleaner/CommandLine.cs,PhotoCleaner/ImportTask.cs,PhotoCleaner/ImportCommand.cs,PhotoCleaner/Database.csPhotoCleaner/TrashDatabase.cs,PhotoCleaner/TrashCommand.cs,PhotoCleaner/ProcessTask.cs,PhotoCleaner/ProcessCommand.csPhotoCleanerTests/ImportTaskTests.cs,PhotoCleanerTests/TrashDatabaseTests.cs,PhotoCleanerTests/TrashCommandTests.cs,PhotoCleanerTests/ProcessTaskTests.cs,PhotoCleanerTests/CommandLineTests.cs,PhotoCleanerTests/DatabaseTests.csREADME.md,ARCHITECTURE.md,GUIDE.md,OPERATIONS.mdcspell.json(granted 2026-11-18: the new option namesimagehashandprocessdbneed the spell-check word list)ptr727 commentedon Nov 18, 2026
Maintainer's answer (2026-11-18, backlog burndown): merge #288 as is. After a duplicate cull, the trashed copy's image hash also matches the kept copy.
process --imagehashthen deletes the kept copy's processed file, andimport --imagehashskips its source. That is the trade-off this issue accepted (equal image data counts as one file). It is opt-in and documented, so no safeguard is required first.