Fix for issue #366

This commit is contained in:
Rhet Turnbull 2021-02-07 09:26:19 -08:00
parent d4513832a6
commit 5c3360f29d
2 changed files with 11 additions and 8 deletions

View File

@ -1,3 +1,3 @@
""" version info """
__version__ = "0.40.9"
__version__ = "0.40.10"

View File

@ -2381,13 +2381,16 @@ def export_photo(
rendered_suffix = rendered_suffix[0]
original_filename = pathlib.Path(filename)
file_ext = (
"." + jpeg_ext
if jpeg_ext and (photo.uti == "public.jpeg" or convert_to_jpeg)
else ".jpeg"
if convert_to_jpeg and photo.uti != "public.jpeg"
else original_filename.suffix
)
file_ext = original_filename.suffix
if photo.isphoto and (jpeg_ext or convert_to_jpeg):
# change the file extension to correct jpeg extension if needed
file_ext = (
"." + jpeg_ext
if jpeg_ext and (photo.uti == "public.jpeg" or convert_to_jpeg)
else ".jpeg"
if convert_to_jpeg and photo.uti != "public.jpeg"
else original_filename.suffix
)
original_filename = (
original_filename.parent
/ f"{original_filename.stem}{rendered_suffix}{file_ext}"