mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Stacks: Add 'rotational' hash attribute to images #1523
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#1523
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rarawls on GitHub (Aug 7, 2022).
In order to 'stack' photos that are the same photo, except either (1) only metadata differs and/or (2) the image has been losslessly rotated... add an additional hash attribute which can be used for stacking and duplicate handling. This does not replace the need/use for taking a hash of the entire file. It adds to duplicate detection/handling.
Disclaimer: probably a more efficient way to do this...
Implementation: For each image, hash the image data only (no metadata) for each possible rotation of the image (0, 90, 180, 270). Sort, concatenate, and hash those four digests. The resulting digest will be the 'rotational hash' of the image and will be shared amongst that same image, regardless of orientation or metadata. Stack the directory, filename, metadata, etc. per usual.
Background: I have duplicates upon duplicates of images that have been managed with different software over the years. My desire is to dump them all into one directory tree and then import them. Many of those files are the exact same file, but rotated. Or they are they have a GPS location added to exif. It would be awesome if those kinds of things got stacked under one photo and (when implemented) deduped.
See https://github.com/knjcode/imgdupes for a basic example of the idea.