mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Apple: Support new Live Photo file names #1277
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#1277
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 @aniqueta on GitHub (Jan 5, 2022).
What does not work as expected?
I'm pointing my PhotoPrism originals folder to my Apple Photos library, and I've noticed that this results in Live Photos not always stacking in PhotoPrism, meaning there are separate entries for the image and videos in the index. It appears this happens for newly imported photos, and old ones in that have been in the Apple Photos library for a while are handled well.
From researching this issue and how PhotoPrism works, I think it's a result of Apple Photos' naming convention for its library package. Each photo gets a random UUID and is organized in a folder structure based on the first character of the UUID and then mapped to a database, thumbnails, etc. It seems that recently, Apple decided to append
_3to the UUID file name for the video associated with a Live Photo image. So, for example the Live Photo will have two files:DFD48C6B-7A49-49A8-86D6-EECA35ABD59B.heicandDFD48C6B-7A49-49A8-86D6-EECA35ABD59B_3.mov.My assumption is that since these file names (sans extension) are not exact matches, PhotoPrism does not stack them together. And, given that Apple Photos seems to have not always had this convention, PhotoPrism handles old Live Photos fine, but new ones that do follow this convention with the appended
_3do not get stacked correctly.How can we reproduce it?
Steps to reproduce the behavior:
~/Pictures/Photos Library.photoslibrary/originalsWhat behavior do you expect?
PhotoPrism stacks Live Photos when handling Apple Photos libraries, and to do this, it would need to match videos associated with images based on having a file name format that is a UUID for the image and then a UUID with appended
_3.movfor the video.I'm happy to help try to code this; I would need some guidance on where this logic should go though, as from a quick search of the code, I cannot find where the matching currently happens in the code.
Can you provide us with example files for testing or screenshots?
I can take and provide some Live Photos without personally identifiable information if needed, but I think the above explanation of file naming covers it?
What version you are using?
Built from source on Dec 29, 2021.
Any other helpful information?
Thanks again for a great project, and I'm happy to help work on this. I suspect I might be the only one using PhotoPrism like this right now, but this is probably useful if/when there's a macOS binary and the average user tries to do something like this.
@upward4 commented on GitHub (Jan 31, 2022):
Please correct me if I'm mistaken, but shouldn't we rely on file metadata rather than filenames to match live photo pairs? See: https://stackoverflow.com/a/35286486
@lastzero commented on GitHub (Jan 31, 2022):
If you want to strictly limit the functionality to Apple devices, then deep inspection of all metadata as outlined on Stackoverflow makes sense. Note we already stack by unique ID, independent of Live Photos.
At the time we implemented this, our users asked for a simple 3 seconds rule:
https://docs.photoprism.app/user-guide/organize/video/#live-photos
@vmartinv commented on GitHub (Feb 15, 2022):
Also interested in this. EDIT: the following bash script is a workaround:
cd imports && for f in $(find . -iname *_3.mov); do echo mv $f ${f/_3.mov/.mov}; doneNote: this is a dry-run, remove echo to actually perform the mass renaming.
@tlvince commented on GitHub (Apr 25, 2022):
Besides the filename and creation time hints, they can be grouped on "Media Group UUID" on the image and "Content Identifier" on the video:
@aniqueta commented on GitHub (May 29, 2022):
I haven't tested this, but I think it would likely break one's photo library, when PhotoPrism is pointed to a Mac's Apple Photos library. This is my setup, so I don't have a full duplicate of the library and can use both PhotoPrism and Apple Photos.
Anyhow, I have found that turning on "Sequential Name" under Settings -> Library has resolved the stacking issue. :)
Edit: I think it's worth leaving this issue open though, so that the stacking could use the identifiers per above.
@Angelmmiguel commented on GitHub (Jul 11, 2022):
I can confirm this solves the issue! Thanks for the tip 😄