Releases: RhetTbull/osxphotos
Bug Fixes
Bug Fixes
A few bug fixes; update for macOS 14.4.
Added
Fixed
- Fix for improperly initialized export db, (#1435)
- Fix for album still created on export when --dry-run parameter is used (#1440)
- Attribute error during PhotoInfo.path (#1445)
- Update macOS tested version for 14.4 (#1429)
Changed
Removed
Contributors
- @RhetTbull @RhetTbull for code.
- @rajscode @rajscode for fixing #1445.
- @jasonhollis@jasonhollis for identifying #1435 and providing debug info.
Hotfix
Compare Libraries
Compare Libraries
Adds new osxphotos compare
command to compare two libraries.
Synopsis:
osxphotos compare [OPTIONS] LIBRARY1 LIBRARY2
osxphotos 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 asset
osxphotos compare \
Test-13.5.1-compare-1.photoslibrary \
Test-13.5.1-compare-2.photoslibrary \
--csv --output compare.csv
Added
- New
osxphotos compare
command to compare two libraries. #939
Fixed
Changed
osxphotos diff
andosxphotos snap
commands 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-orientation
flag toosxphotos export
command 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
sync
andimport
which improves reliability and makes it possible to implement theosxphotos compare
command. #1389 - If a path is invalid in the
osxphotos export
command 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 repl
to 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-orientation
flag.
Hot fix for speed issue
[v0.67.3] - 2024-01-13
Fixes for --checkpoint
causing unnecessary slowdown.
Added
Removed
Changed
osxphotos export --checkpoint
no 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:Rating
field with--sidecar
and--exiftool
options. (#1353) osxphotos import --sidecar-template
renamed to--sidecar-filename
to avoid ambiguity with theosxphotos export
option--sidecar-template
. (#1351)- Photos in shared albums are now excluded from
--not-incloud
as 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:Rating
field with iPhoto. - @finestream @finestream for suggesting the change to
--sidecar-template
for 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.csv
This 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
--sidecar
and--sidecar-template
toosxphotos import
to import metadata from sidecar files during import. Supported sidecar formats are XMP, osxphotos JSON, exiftool JSON, and Google Takeout JSON.--sidecar
will automatically find the sidecar (even with Google Takeout's weird naming scheme) and--sidecar-template
allows to specify the sidecar file name using a template. - Added
--dup-albums
toosxphotos import
to 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-date
toosxphotos import
to parse date from folder name just as--parse-date
can parse date from the filename.--parse-folder-date
and--parse-date
can 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/01
and time from filename likeIMG_1234_125600.jpg
. - Added
--check
,--repair
toosxphotos exportdb
to check and repair database - Added
--history
toosxphotos exportdb
to 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 --history
to see why a specific file or UUID was exported or skipped and the history of the file. - The report format for
osxphotos import
has changed (added photo date to report), thus if you use--report --append
you'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
--sidecar
toosxphotos 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 --album
to 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 --checkpoint
to auto-save the export database during export when using--ramdb
. This prevents data loss if the export is interrupted or crashes. If using--ramdb
and--checkpoint
is not identified, export database will be auto-saved every 1000 photos (#1051)osxphotos push-exif --dry-run
to show what will be pushed without updating metadata (#1259)osxphotos export --ignore-exportdb
to ignore warnings about exporting into a folder with an existing export database without using--update
(#1285)osxphotos export --no-exportdb
to export without creating an export database; use with caution as this is a "one time" export that will not work with--update
in the futureosxphotos import --dry-run
toosxphotos import
to show what would be imported without actually importingosxphotos import --skip-dups
to 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
--library
or--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/export
you must now change it to:
osxphotos export --library ~/Pictures/Photos\ Library.photoslibrary /path/to/export
Changed
osxphotos import
now prints a message if the photo is already in the library (#1264)osxphotos export
now checks if the destination is a Photos library and warns if it is (#1268)osxphotos export
now 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 export
command 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.py
osxphotos 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
library
to 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