From 5c3360f29d52df2f804c70f37a2ca9a3f102d93c Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 7 Feb 2021 09:26:19 -0800 Subject: [PATCH] Fix for issue #366 --- osxphotos/_version.py | 2 +- osxphotos/cli.py | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/osxphotos/_version.py b/osxphotos/_version.py index 8b8cc157..24479d29 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.40.9" +__version__ = "0.40.10" diff --git a/osxphotos/cli.py b/osxphotos/cli.py index 6d4b834a..e2133e9a 100644 --- a/osxphotos/cli.py +++ b/osxphotos/cli.py @@ -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}"