-
Notifications
You must be signed in to change notification settings - Fork 93
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
RAW+JPEG files not converted with --convert-to-jpeg
#469
Comments
A small test db would be great! You can email it or a link to me at Rturnbull+git@gmail.com I'm traveling and won't be able to take a look until this weekend. |
Just looked at the code in _photoinfo_export.py and I think I see the issue. RAW+JPEG have a UTI of 'public.jpeg' in Photos even if the RAW is selected as the original so the conversion never gets triggered. Will need to think about the best way to bands this. Not sure everyone will want the raw converted if there's already a jpeg. Also need to avoid name collisions when the jpeg is also exported. uti = self.uti if edited else self.uti_original
if convert_to_jpeg and self.isphoto and uti != "public.jpeg":
# not a jpeg but will convert to jpeg upon export so fix file extension
fname_new = pathlib.Path(fname)
ext = "." + jpeg_ext if jpeg_ext else ".jpeg"
fname = str(fname_new.parent / f"{fname_new.stem}{ext}")
else:
# nothing to convert
convert_to_jpeg = False |
PS -- you get the osxphotos Power User badge! Love to see some of the newer features like template filters and functions "in the wild"! |
Yea, I was experimenting with it yesterday and it worked out great for customizing export names just how I want them. |
Ahh, I didn't realize that they both got exported. In that case, seems like if |
At the very least, I need to update the documentation to make it clear what happens in the case of RAW+JPEG. You could use |
The majority of my photos are plain RAW files. Wouldn't that also skip those rather than convert them to JPEG? |
Just re-read the docs. That's definitely what I want. Thanks!
|
No. It only skips the RAW component of the RAW+JPEG pair. (And thus, perhaps the Here's the actual code: it looks at photo.has_raw which is True if the photo has an associated RAW image but False if the photo is itself a RAW image without a JPEG pair as yours are. Setting osxphotos/osxphotos/photoinfo/_photoinfo_export.py Lines 810 to 830 in 5143b16
|
Another flag I probably want since I've got a few of those imported. |
I updated the help text in v0.42.39 to try to make it more clear what --convert-to-jpeg actually does with RAW+JPEG pairs. |
Noticed that some (all?) of my photos that are RAW+JPEG aren't converted when exported with
--convert-to-jpeg
. I've seen this for both Sony.arw
and Nikon.nef
files I have. Here's the full command that I'm runningIf you need it I can also put together a test db with a few of the problematic files.
The text was updated successfully, but these errors were encountered: