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.2.1.tar.gz (10.1 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.2.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for update_photo_bookmarks-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fe43e9d61f9e7f2f7d944adb9bceb3aa5c712ab7b301bd7710065805ed2cae68
MD5 911efb27cde2bb50c7125b606c4fe940
BLAKE2b-256 47ceae5e9fdd2677bd2eca1a33d59afd22cbbe83a73876852cfd8087f0e238c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for update_photo_bookmarks-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf79bbf54cd3a5c74f6866a792d316bb8de161e174b7b1c7b04b7461d955c80e
MD5 3a6922d0f6241801e1e5d60f0ae708f1
BLAKE2b-256 10ffbebfefcbb1f47ad3bfff452b361be95fc294a235352bc4833569d2681e91

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