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

Intermittent Crash with --xmp-sidecar Flag When Downloading Edited Photos #1056

Open
UnoSee opened this issue Jan 14, 2025 · 1 comment
Open
Labels

Comments

@UnoSee
Copy link

UnoSee commented Jan 14, 2025

Overview

When using the --xmp-sidecar flag in icloudpd, the program intermittently crashes when processing certain edited photos. The crash results in a JSON decoding error, halting the download process and requiring manual intervention.

Steps to Reproduce

  1. Use the --xmp-sidecar flag when running icloudpd.
  2. Include a mix of edited and unedited photos in the download.
  3. Observe that the program crashes intermittently when encountering certain edited photos.

Expected Behavior

The program should process all photos, including edited ones, without crashing and generate valid XMP sidecar files.

Actual Behavior

The program crashes with the following traceback:

Traceback (most recent call last):
  File "starters\icloudpd.py", line 6, in <module>
  File "click\core.py", line 1161, in __call__
  File "click\core.py", line 1082, in main
  File "click\core.py", line 1443, in invoke
  File "click\core.py", line 788, in invoke
  File "icloudpd\base.py", line 767, in main
  File "icloudpd\base.py", line 1376, in core
  File "icloudpd\base.py", line 989, in download_photo_
  File "icloudpd\xmp_sidecar.py", line 69, in generate_xmp_file
  File "icloudpd\xmp_sidecar.py", line 91, in build_metadata
  File "json\__init__.py", line 346, in loads
  File "json\decoder.py", line 345, in decode
  File "json\decoder.py", line 363, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[PYI-4468:ERROR] Failed to execute script 'icloudpd' due to unhandled exception!

Context

This bug is particularly disruptive because it makes unattended downloads impossible. I have to monitor logs constantly to ensure the program hasn't crashed, and when it does, I need to take manual steps to continue the download.

Workarounds

  • If the photo is not important, I delete the edited version before running icloudpd again.
  • If the photo is important, I revert it to its original version before resuming the download.

Both workarounds require constant attention and are inefficient.

This issue seems specific to some edited photos, as not all of them trigger the crash.

@UnoSee UnoSee added the bug label Jan 14, 2025
@chkuendig
Copy link
Contributor

I noticed the same, but in my case this was happening with screenshots. #1009 should fix this.

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

No branches or pull requests

2 participants