Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using --exiftool-option '-IPTCDigest=new' generates WARNING - exiftool.py - 421 - error loading json returned by exiftool #1770

Open
oPromessa opened this issue Dec 29, 2024 · 4 comments

Comments

@oPromessa
Copy link
Contributor

oPromessa commented Dec 29, 2024

Before submitting a bug report, please ensure you are running the most recent version of osxphotos and that the bug is reproducible on the latest version

osxphotos, version 0.69.2
Python 3.11.5 (main, Aug 24 2023, 15:23:30) [Clang 14.0.0 (clang-1400.0.29.202)]
Python executable: /Users/XXX/Documents/Apps/osxphotos/venv3.11/bin/python3.11
macOS 12.7.6, x86_64

Describe the bug
Adding --exiftool-option '-IPTCDigest=new' to osxphotos export as per following toml generates the warning below. It sill exports the file and as far as I could tell it does apply the option.

exiftool = true
exiftool_merge_keywords = true
exiftool_merge_persons = true
exiftool_option = [ "-IPTCDigest=new",]
2024-12-29 18:24:15.766272 -- Exporting DSC02357.JPG (DSC02357.JPG) (3/3)
2024-12-29 18:24:15.772771 -- Writing metadata with exiftool for DSC02357.JPG
2024-12-29 18:24:15,928 - root - WARNING - exiftool.py - 421 - error loading json returned by exiftool: Extra data: line 1 column 3 (char 2) 1 image files updated
2024-12-29 18:24:16.056927 -- Exported DSC02357.JPG to XXX

To Reproduce
Use --exiftool --exiftool-option '-IPTCDigest=new' options.

Expected behavior
No warning and taking option.

Screenshots
N/A

Desktop (please complete the following information):

osxphotos, version 0.69.2
Python 3.11.5 (main, Aug 24 2023, 15:23:30) [Clang 14.0.0 (clang-1400.0.29.202)]
Python executable: /Users/XXX/Documents/Apps/osxphotos/venv3.11/bin/python3.11
macOS 12.7.6, x86_64

Additional context
N/A

@oPromessa
Copy link
Contributor Author

I guess it is a known situation. Would if have any major impact on for instance all the json info exiftool and checking differences on future exports?

except Exception as e:
# will fail with some commands, e.g --ext AVI which produces
# 'No file with specified extension' instead of json
logging.warning(f"error loading json returned by exiftool: {e} {json_str}")
return dict()

@RhetTbull
Copy link
Owner

What is the purpose of this option? If this error occurs, no data is returned by exiftool commands (but as you noted, the write may still succeed).

@oPromessa
Copy link
Contributor Author

exiftool for some pics notifies of Warning: IPTCDigest is not current. XMP may be out of sync

From what I could gather, an older metadata section IPTC IIM was replaced by section XMP.
Older apps may still use IPTC IIM and newer apps are using XMP.
IPTCDigest is an hash to indicate the data present in both sections is synced.

Based on https://exiftool.org/forum/index.php?topic=13273.0 one can solve it with either:

  • -IPTCDigest=new : which updates the digest
  • -IPTCDigest= : which deletes this tag

So I was trying to update it on export.

@RhetTbull
Copy link
Owner

OK, thanks. I'll take a look to see how I can get this working. It might be good to just enable this by default when writing with exiftool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants