Skip to main content

A module for managing photo bookmarks in a mac OS photo librarydatabase

Project description

photobookmarks

This is a tool to update the referenced files in mac os photos app. It is heavily influenced by https://github.com/RhetTbull/RepairPhotosBookmarks.

This version was tested on macOS 15.4 (Sequoia)

Introduction

Photos has two modes how to manage the locoation of photos.

  1. Photos are copied into the media library, in this case you don't need this tool.
  2. The imported photos are not copied into your library, they are stored on your harddisk/NAS/USB drive/...

In the second case you can get into trouble if you move your files into a new location, e.g.:

  1. You have a new mac
  2. you want to move your files to a new SSD
  3. Your harddisk is broken and you restore your photos from a backup
  4. ...

In photos you can relocate photos one by one, which is not feasible if you manage 1000+ photos. That's why I created this little tool.

How to use it

The reference to a file/photo is stored in a "Bookmark" [https://developer.apple.com/documentation/professional-video-applications/using-bookmark-data]. These Bookmarks can only be created by the app which is using it. Therefore the first step is to create a new library with all moved files. You could also add much more files. Open photos by pressing holding the 'alt' key and press the "Create New ..." button to create a new library. Ensure that the setting "Copy Items to the Photo library" is disabled. From the menu choose 'File -> Import' and select the folder with your moved files/photos. You can import all photos at once. Time to get a coffee.

In the meantime you can install the script with pip install update_photo_bookmarks. The script needs the current library as well as the just created library with the new locations. The script checks for each referenced image if there is a match in the new library. An image is considerd as equal if the original name and the timestamp (usually time when taking the picture) match. If that is the case all references will be updated in the current library.

This scripts updates photo bookmarks in an MacOS photo library

options:
-h, --help            show this help message and exit
-u UPDATED_BOOKMARK_LIBRARY_PATH, --updated_bookmark_library_path UPDATED_BOOKMARK_LIBRARY_PATH
                        Path to the photo library with updated bookmarks
-p PHOTOS_LIBRARY_PATH, --photos_library_path PHOTOS_LIBRARY_PATH
                        Path to the iCloud photo library which should be modified
-v, --verbose         Enable verbose output
-d, --dry_run         Do not make any changes, just print what would be done
-o OUTPUT_FILE, --output_file OUTPUT_FILE
                        Path to the output destination

Example how to use it:

update_photo_bookmarks.py -u 'tmp/2024_updates.photoslibrary' -p '~/pictures/Fotos Library-fixed.photoslibrary'

Notes

Of course I suggest to have a backup of your library before running this script.

This is my first python project, happy if you find any issues or have suggestions for improvement. Happy coding!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

update_photo_bookmarks-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

update_photo_bookmarks-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file update_photo_bookmarks-0.1.0.tar.gz.

File metadata

  • Download URL: update_photo_bookmarks-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for update_photo_bookmarks-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8e62e5e0e3a0b6445c4a0244ca50fa406f823087fa01b960ba9199ca2bd2e893
MD5 d59253a3a3cfd3ae1fcb351d1893303e
BLAKE2b-256 d17c2b66531114876b45635fcd03ce418a2992b83fc3ff62bb7bfee421c60b58

See more details on using hashes here.

File details

Details for the file update_photo_bookmarks-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for update_photo_bookmarks-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 281cc7c7706fd245eeb0dfc76629ea125603dbec58ad7e79339bc70a5ebb22a5
MD5 b621bbbd84498ceff2c54a4639042b19
BLAKE2b-256 8ccca76348b2d9883ac7c5ca8bb1a20c3f1640a72f2dc2ed5649e4bc7c71bc09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page