Closed kitschpatrol closed 7 months ago
Thanks for the detailed report and test library. This will be helpful for debugging this! I'll take a look as soon as I have chance.
@all-contributors please add @kitschpatrol for bug
@all-contributors please add @kitschpatrol for bug
@RhetTbull
I've put up a pull request to add @Thanks! :tada:
I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.
I've put up a pull request to add @kitschpatrol! :tada:
@RhetTbull
@kitschpatrol already contributed before to bug
Thank you.
As a work-around for now I've patched extra TypeError
checks in adjustmentsinfo.py
, so that the (currently) un-parsable Photomator adjustment metadata is ignored.
I can see how supporting every possible adjustment data format would be out of scope for this tool, so maybe this approach makes sense? Or maybe it would better to indicate that data was present but unparsable by some means other than empty values?
I can see how supporting every possible adjustment data format would be out of scope for this tool, so maybe this approach makes sense? Or maybe it would better to indicate that data was present but unparsable by some means other than empty values?
Yes, it's not possible to parse every format that an external editor might use. It might be best just to log a warning and return None or an empty dictionary. I'll take a look at the code and see what makes sense.
Thanks, sounds good. I just created a fork with the minimal changes required to (silently) ignore the missing fields when querying the example library I provided.
This is fixed in main and will be included in next release
Thanks for this fantastic tool!
This is a bit of an edge case, and it's likely Photomator is doing something funky here, but I noticed that Photos libraries containing images edited in specific ways by Photomator can break
osxphotos query --json
output.I've attached a single-photo test library that triggers the bug.
The error seems to come from parsing adjustments metadata added to the library when the "Super Resolution" feature is used in Photomator.
Sepcifically,
adjustmentsinfo.py:115
:Throws:
Inspecting
self._adjustments
of the offending image shows the following:Seems like the expected
"adjustments"
key is missing.To Reproduce from scratch:
osxphotos query --json
To Reproduce with the attached sample library:
osxphotos query --library "Path/To/PhotomatorTest.photoslibrary" --json
Expected behavior: Normal JSON photo info output.
Running the same command without the
--json
flag does not trigger the error and produces normal output.Desktop Mac: osxphotos, version 0.67.10 Python 3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)] macOS 14.4.1, arm64