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

Sidecar file not generated for edited files #1346

Closed
finestream opened this issue Dec 26, 2023 · 9 comments
Closed

Sidecar file not generated for edited files #1346

finestream opened this issue Dec 26, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@finestream
Copy link
Contributor

** 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 **
Confirmed

Describe the bug
Edited files do not get a sidecar

To Reproduce
osxphotos export \
--update
--cleanup
--ramdb
--jpeg-ext jpeg
--filename '{created.date}_{created.hour}.{created.min}.{created.sec}'
--directory '{edited?{edited_version?Collection,Originals},Collection}/{created.year}/{created.mm}'
--touch-file
--sidecar JSON
--keyword-template '{favorite?Favorite,}'
--keyword-template '{photo.hidden?Private,}'
--library

Expected behavior
for edited file I expect a json file yyyy-mm-dd_hh.mm.ss_edited.jpeg.json

Screenshots
N/A

Desktop (please complete the following information):

  • OS: MacOS 14.2.1
  • osxphotos version (osxphotos --version): 0.67.0

Additional context
see comments to #1322

@RhetTbull RhetTbull added the bug Something isn't working label Dec 26, 2023
@RhetTbull
Copy link
Owner

@all-contributors please add @finestream for bugs

Copy link
Contributor

@RhetTbull

I've put up a pull request to add @finestream! 🎉

@RhetTbull
Copy link
Owner

I've confirmed this behavior.

IMG_4179.jpeg
IMG_4179.jpeg.xmp
IMG_4179_edited.jpeg

@RhetTbull
Copy link
Owner

Problem is here:

sidecar_writer = SidecarWriter(self.photo)
all_results += sidecar_writer.write_sidecar_files(dest=dest, options=options)

The sidecar gets written only for the original file name.

@RhetTbull
Copy link
Owner

If --skip-original-if-edited is used, the edited sidecar does get generated.

@RhetTbull
Copy link
Owner

Interesting....write_sidecar_files is called for the edited file but no sidecar is written.

2024-01-01T08:55:33.437060 write_sidecar_files called from __call__ with args: () and kwargs: {'dest':
PosixPath('/Users/rhet/Desktop/export/wedding_edited.jpeg'), 'options': ExportOptions(convert_to_jpeg=False, description_template=None,
download_missing=False, dry_run=False, edited=True, exiftool_flags=(), exiftool=False, export_as_hardlink=False, export_db=<osxphotos.export_db.ExportDB
object at 0x10f26eea0>, face_regions=True, fileutil=<class 'osxphotos.fileutil.FileUtilMacOS'>, force_update=False, ignore_date_modified=False,
ignore_signature=False, increment=True, jpeg_ext=None, jpeg_quality=1.0, keyword_template=(), live_photo=True, location=True, merge_exif_keywords=False,
merge_exif_persons=False, overwrite=False, persons=True, preview_suffix='_preview', preview=False, raw_photo=False,
render_options=RenderOptions(none_str='_', path_sep='/', expand_inplace=False, inplace_sep=',', filename=False, dirname=False, strip=False,
edited_version=False, export_dir='/Users/rhet/Desktop/export', dest_path='/Users/rhet/Desktop/export',
filepath='/Users/rhet/Desktop/export/wedding_edited.jpeg', quote=False, caller='export'), replace_keywords=False, rich=True, export_aae=False,
sidecar_drop_ext=False, sidecar=0, strip=False, timeout=120, touch_file=False, update=False, update_errors=False, use_albums_as_keywords=False,
use_persons_as_keywords=False, use_photokit=False, use_photos_export=False, verbose=<function noop at 0x10eb8d6c0>, tmpdir=None, favorite_rating=False)}
2024-01-01T08:55:33.437060 write_sidecar_files returned: ExportResults(datetime=2024-01-01T08:55:33.455364, converted_to_jpeg=[], deleted_directories=[],
deleted_files=[], error=[], exif_updated=[], exiftool_error=[], exiftool_warning=[], exported=[], exported_album=[], metadata_changed=[], missing=[],
missing_album=[], new=[], aae_written=[], sidecar_exiftool_skipped=[], sidecar_exiftool_written=[], sidecar_json_skipped=[], sidecar_json_written=[],
sidecar_xmp_skipped=[], sidecar_xmp_written=[], sidecar_user_written=[], sidecar_user_skipped=[], sidecar_user_error=[], skipped=[], skipped_album=[],
to_touch=[], touched=[], updated=[], xattr_skipped=[], xattr_written=[], user_written=[], user_skipped=[], user_error=[]), elapsed time:
0.00018601398915052414 sec

@RhetTbull
Copy link
Owner

write_sidecar_files is being called with sidecar=0 for the edited file.

@RhetTbull
Copy link
Owner

Found the issue...was in the cli/export.py code.

RhetTbull added a commit that referenced this issue Jan 1, 2024
RhetTbull added a commit that referenced this issue Jan 1, 2024
@RhetTbull
Copy link
Owner

Fixed in v0.67.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants