Releases: RhetTbull/osxphotos
Compare Libraries
Compare Libraries
Adds new osxphotos compare command to compare two libraries.
Synopsis:
osxphotos compare [OPTIONS] LIBRARY1 LIBRARY2osxphotos compare Test-13.5.1-compare-1.photoslibrary Test-13.5.1-compare-2.photoslibrary
library_a = Test-13.5.1-compare-1.photoslibrary
library_b = Test-13.5.1-compare-2.photoslibrary
in_a_not_b = 1 asset
in_b_not_a = 2 assets
in_a_and_b_same = 2 assets
in_a_and_b_different = 1 assetosxphotos compare \
Test-13.5.1-compare-1.photoslibrary \
Test-13.5.1-compare-2.photoslibrary \
--csv --output compare.csvAdded
- New
osxphotos comparecommand to compare two libraries. #939
Fixed
Changed
osxphotos diffandosxphotos snapcommands are now hidden as these are primarily for osxphotos developers or those hacking on the Photos library. To see hidden commands, useOSXPHOTOS_SHOW_HIDDEN=1 osxphotos help. #1427
Removed
Contributors
- @RhetTbull @RhetTbull for code.
- @rajscode @rajscode for fixing an incorrect comment in the code.
Bug Fixes
Bug Fixes
This release includes a few bug fixes as well as a new feature to fix photo orientation upon export.
Added
--fix-orientationflag toosxphotos exportcommand to automatically adjust the orientation of exported photos to match the orientation stored in the Photos database. This is mostly useful for iPhoto libraries which do not treat orientation adjustments as edits and thus no edited image with the correct orientation is created. #1396
Fixed
- Unified the fingerprint code for
syncandimportwhich improves reliability and makes it possible to implement theosxphotos comparecommand. #1389 - If a path is invalid in the
osxphotos exportcommand and the passed path includes smart quotes, the error message will now tell the user to remove the smart quotes. This fixes a common user error when pasting from TextEdit or Notes that use smart quotes. #1408 - Fixed
osxphotos replto work when connected via SSH. #1332
Changed
- Added index to history table in export databasel; this should speed up exports with
--update(migrates export database to version 9.1)
Removed
Contributors
- @RhetTbull @RhetTbull for code.
- @mlevin77 @mlevin77 for suggesting the
--fix-orientationflag.
Hot fix for speed issue
[v0.67.3] - 2024-01-13
Fixes for --checkpoint causing unnecessary slowdown.
Added
Removed
Changed
osxphotos export --checkpointno longer automatically checkpoints during export. See #1083.
Fixed
Contributors
- @RhetTbull @RhetTbull for code.
- @rajscode @rajscode for finding the issue with checkpoint.
Bug fix for --sidecar
[v0.67.2] - 2024-01-01
Fixes for `--sidecar`` when exporting edited photos.
Added
Removed
Changed
Fixed
- Sidecar not written for edited photo when exporting both original and edited photo. (#1346)
Contributors
- @RhetTbull @RhetTbull for code.
- @finestream @finestream for finding the bug with
--sidecar.
Happy New Year Release
[v0.67.1] - 2023-12-31
Fixes for iPhoto export and Google Takeout import.
Added
Removed
Changed
- iPhoto export will now write the photo rating to the
XMP:Ratingfield with--sidecarand--exiftooloptions. (#1353) osxphotos import --sidecar-templaterenamed to--sidecar-filenameto avoid ambiguity with theosxphotos exportoption--sidecar-template. (#1351)- Photos in shared albums are now excluded from
--not-incloudas this caused confusion for usesrs (#1366)
Fixed
- Fixed query could sometimes fail with iPhoto library.
- Fixed Google Takeout was importing timestamps incorrectly. (#1356)
Contributors
- @RhetTbull @RhetTbull for code.
- @LunarLanding @LunarLanding for finding bug in import and submitting the fix.
- @mlevin77 @mlevin77 for idea to use
XMP:Ratingfield with iPhoto. - @finestream @finestream for suggesting the change to
--sidecar-templatefor import.
Import support for sidecars, Google Takeout
[v0.67.0] - 2023-12-23
Several enhancements to osxphotos import that now allow it to be used to import a Google Takeout archive into Photos.app. Enhancements to osxphotos export to store the history of exported photos and videos in the export database and to allow checking and repairing the export database with osxphotos exportdb.
For example, to import a Google Takeout archive into Photos.app:
Download the Google Photos Takeout archive from Google and unzip it. This will create a folder with a name like Takeout. Inside this folder will be a folder named Google Photos which contains all the photos and videos. You can import the photos and videos into Photos.app using the following command (assuming you unzipped the Takeout file in your Downloads folder):
osxphotos import ~/Downloads/Takeout/Google\ Photos --walk --album "{filepath.parent.name}" --skip-dups --dup-albums --sidecar --verbose --sidecar-ignore-date --keyword "{person}" --report takeout_import.csvThis will import all the photos and videos into Photos.app, creating albums with the same name as the folder they were in in the Takeout archive (which is how Google Takeout stores photos in albums). It will skip duplicates (Google Takeout exports duplicate copies of photos that are in more than one album) but add the duplicate photo that's already in the library to the albums it would have been added to if it were imported (--skip-dups --dup-albums). It will also import metadata from the sidecar files (Google Takeout exports metadata in JSON format) (--sidecar).
The --sidecar-ignore-date option is optional but prevents osxphotos from setting the photo's date from the sidecar metadata. This is helpful because Google Takeout does not preserve the timezone of the photo in the Takeout metadata but converts all times to UTC. This will be handled by osxphotos by converting to local timezone upon import. However, if the photo's already have correct time in the EXIF data, --sidecar-ignore-date will prevent osxphotos from setting the date from the sidecar metadata, allowing Photos to set the date from the image.
The --keyword "{person}" option will add any people in the photo to the photo's keywords. The osxphotos import command cannot set person info in Photos (this is a limitation of Photos) but Google will preserve the person names if you've used the face naming feature. You can optionally include --keyword "{person}" to add keywords for the persons found in each image.
The --report takeout_import.csv option will create a report of the import in CSV format.
, adding keywords for any people in the photo, and importing metadata from any sidecar files (XMP, osxphotos JSON, exiftool JSON, or Google Takeout JSON). The --sidecar-ignore-date flag is needed because Google Takeout does not preserve the original date of the photo in the sidecar file. The --report flag will create a report of the import in CSV format.
Added
- Added
--sidecarand--sidecar-templatetoosxphotos importto import metadata from sidecar files during import. Supported sidecar formats are XMP, osxphotos JSON, exiftool JSON, and Google Takeout JSON.--sidecarwill automatically find the sidecar (even with Google Takeout's weird naming scheme) and--sidecar-templateallows to specify the sidecar file name using a template. - Added
--dup-albumstoosxphotos importto add photos to the appropriate albums even if photo is skipped due to--skip-dups. This will add the duplicate photo already in the library to the albums the photo would have been added to if it were imported. - Added
--parse-folder-datetoosxphotos importto parse date from folder name just as--parse-datecan parse date from the filename.--parse-folder-dateand--parse-datecan be used together if part of the date is in the filename and part in the folder name. For example--parse-folder-date "%Y/%m/%d" --parse-date "%H%M%S"would parse a date from a folder name like2021/01/01and time from filename likeIMG_1234_125600.jpg. - Added
--check,--repairtoosxphotos exportdbto check and repair database - Added
--historytoosxphotos exportdbto show history of exported photos and videos
Removed
Changed
- Export database now stores history of exported photos and videos which can be used with
osxphotos exportdb --historyto see why a specific file or UUID was exported or skipped and the history of the file. - The report format for
osxphotos importhas changed (added photo date to report), thus if you use--report --appendyou'll need to archive the existing reports and start fresh with this version.
Fixed
Contributors
- @RhetTbull @RhetTbull for code
- @finestream @finestream for the idea to add
--sidecartoosxphotos import - @mikekenyon99 @mikekenyon99 for the idea to add a repair option to
osxphotos exportdb
Bug Fixes for Monterey, Template Sort Order
Bug Fixes
[v0.66.0] - 2023-12-10
Added
Removed
Changed
- Templates which return lists of strings such as
{album}now return results in sorted order #1317
Fixed
- Fixed install issues for Monterey, #1324
Contributors
- @RhetTbull @RhetTbull for code
Thanksgiving Release
Thanksgiving Release
A cornucopia of new features and bug fixes for the Thanksgiving holiday. Thanks to all the contributors who helped make this release possible. Please note there are some breaking changes in this release, see notes below. If you have scripts or workflows that use osxphotos CLI commands, you may need to update them to specify the library with --library or --db instead of as a positional argument.
[v0.65.0] - 2023-11-25
Added
osxphotos batch-edit --albumto add photos to an album (#1009)
This allows batch-edit to be used to sync albums between iCloud shared libraries (Photos does not sync albums between shared libraries). For example:
osxphotos batch-edit --verbose --keyword "{album?album:{folder_album}}"will write the album name in form album:Folder/Album to the keyword field. Then on the other user's machine:
osxphotos batch-edit --verbose --album "{keyword|filter(startswith album:)|sslice(6:)}" --split-folder "/" reads the album name from the keyword field and splits it into folder and album name and adds the photo to the album, creating album and folders as necessary.
Both commands can be run on each user's machine to sync albums between shared libraries. The commands can also be combined into a single command:
osxphotos batch-edit --verbose --album "{keyword|filter(startswith album:)|sslice(6:)}" --split-folder "/" --keyword "{album?album:{folder_album}}"osxphotos export --checkpointto auto-save the export database during export when using--ramdb. This prevents data loss if the export is interrupted or crashes. If using--ramdband--checkpointis not identified, export database will be auto-saved every 1000 photos (#1051)osxphotos push-exif --dry-runto show what will be pushed without updating metadata (#1259)osxphotos export --ignore-exportdbto ignore warnings about exporting into a folder with an existing export database without using--update(#1285)osxphotos export --no-exportdbto export without creating an export database; use with caution as this is a "one time" export that will not work with--updatein the futureosxphotos import --dry-runtoosxphotos importto show what would be imported without actually importingosxphotos import --skip-dupsto skip importing photos that are already in the library (#1262, #1264)
Removed
- Removed photos library argument from CLI commands which had previously been deprecated; library must now be specified with
--libraryor--db
WARNING: This is a breaking change if you have scripts that use osxphotos CLI commands and specify the library as a positional argument. You must now specify the library with --library or --db. For example, if you have a script that looks like this:
osxphotos export ~/Pictures/Photos\ Library.photoslibrary /path/to/exportyou must now change it to:
osxphotos export --library ~/Pictures/Photos\ Library.photoslibrary /path/to/exportChanged
osxphotos importnow prints a message if the photo is already in the library (#1264)osxphotos exportnow checks if the destination is a Photos library and warns if it is (#1268)osxphotos exportnow checks if the destination is a folder with an existing export database and warns if exporting without--update(#1285)export_cli()can now be used to run theosxphotos exportcommand as a stand-alone function in your own code (#1253):
>>> from osxphotos.cli.export import export_cli
>>> export_cli(dest="/private/tmp", update=True)-
--query-function(query,export),--post-function(export),--function(timewarp),osxphotos run, and{function}template now all support providing a URL to a Python file containing the function (#1224). This allows sharing of functions and makes it easier to give examples to new users. For example:osxphotos run https://raw.githubusercontent.com/RhetTbull/os�P1$r2 q�\�[?12;2$yxphotos/main/examples/count_photos.pyosxphotos query --quiet --print "{function:https://raw.githubusercontent.com/RhetTbull/osxphotos/main/examples/template_function.py::example}"osxphotos query --query-function https://raw.githubusercontent.com/RhetTbull/osxphotos/main/examples/find_unnamed_faces.py::unnamed_faces --count
-
CLI commands now show progress when loading the Photos library to stderr. This is useful when running commands against a large database on a slow disk
Fixed
- Allow
libraryto be specified in config TOML file (#1274)
Contributors
- Rhet Turnbull (@RhetTbull) for code, documentation, and testing
- Added @nicad (@nicad) as a contributor for bug, test, and documentation
- Added @nkxco (@nkxco) as a contributor for ideas
- Added @santiagoGPNC (@santiagoGPNC) as a contributor for ideas
- Added @mikapietrus (@mikapietrus) as a contributor for ideas
Added --alt-db option to export
Alt DB Option
Adds --alt-db option to export. You probably (almost certainly) don't need this.
[v0.64.3] - 2023-10-22
Added
--alt-dboption to export to specify a different database than the one in the Photos library. This is a niche option you likely don't need but enables certain use cases that previously weren't possible.
Removed
Changed
Fixed
Contributors
- @RhetTbull @RhetTbull for code and testing
Support for Python 3.12
Support for Python 3.12
Updated dependencies for Python 3.12
[v0.64.2] - 2023-10-21
Added
Removed
Changed
Fixed
- Support for Python 3.12, #1254
Contributors
- @RhetTbull @RhetTbull for code and testing