RhetTbull / osxphotos

Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.
MIT License
2.01k stars 94 forks source link

get_uti_for_extension fails on Monterey #556

Open narensankar0529 opened 2 years ago

narensankar0529 commented 2 years ago

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

 /opt/tmp/ osxphotos --version osxphotos, version 0.43.6

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. What' the full command line you used with osxphotos?
  2. What was the error output?

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

narensankar0529 commented 2 years ago

osxphotos export --update --cleanup --not-hidden --not-shared --not-screenshot \ --skip-original-if-edited --skip-raw --skip-live --skip-bursts \ --touch-file \ --export-as-hardlink \ --sidecar xmp \ --sidecar-drop-ext \ --jpeg-ext jpg \ --keyword-template "{place.name.country}" \ --keyword-template "{place.name.city}" \ --keyword-template "{place.name.state_province}" \ --keyword-template "{place.name.area_of_interest}" \ --keyword-template "{label_normalized}" \ --keyword-template "{searchinfo.venue_type}" \ --keyword-template "{searchinfo.season}" \ --keyword-template "{searchinfo.holiday}" \ --keyword-template "{searchinfo.activity}" \ --keyword-template "{searchinfo.venue}" \ --keyword-template "{searchinfo.venue_type}" \ --directory '{photo_or_video}/{created.year}/{created.month}/{created.dd}' \ --filename "{mediatype}${nORs}{created.yy}{created.mm}{created.dd}{uuid}" \ --report $logFileName.csv \ ${libraryExportDir} >> $logFileName 2>&1

narensankar0529 commented 2 years ago

On macOS Monterey iCloudPhotos_silvialin.20211222-003006.txt

RhetTbull commented 2 years ago

Thanks for the log file -- this is helpful. The actual error is this:

CalledProcessError: Command '['/usr/bin/mdls', '-name', 'kMDItemContentType', 
'/var/folders/97/_q7xyg5d32jgvtrgrkv9v0c80000gp/T/tmpi9zce005.HEIC']' returned 
non-zero exit status 1.

Because some of the system calls I use to determine the correct file extension are deprecated in Monterey (which I don't have access to for testing) I put in a hack to try to determine the correct file extension and unfortunately that's failing. I'll take a look at the code and see what else I can do to work around this.

RhetTbull commented 2 years ago

I made a fix that I think will fix this but I'm traveling and can't push a new release. I'll push a new release when I can.

RhetTbull commented 2 years ago

I think this is fixed in v0.43.7. Let me know if it's still causing problems. This is partial fix -- will work on a more robust fix the underlying problem when I can get access to a Monterey machine.

narensankar0529 commented 2 years ago

For now don't see the errors any more