From aeae1e0b8ac59a2171af3f5f6661f182089df183 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 22 Mar 2020 08:53:54 -0700 Subject: [PATCH] Fixed unnecessary warning exporting .JPG to .jpeg --- osxphotos/photoinfo.py | 7 ++++++- osxphotos/utils.py | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/osxphotos/photoinfo.py b/osxphotos/photoinfo.py index a78e93c5..1cbca9c3 100644 --- a/osxphotos/photoinfo.py +++ b/osxphotos/photoinfo.py @@ -616,7 +616,12 @@ class PhotoInfo: # use suffix from the non-edited file actual_suffix = pathlib.Path(self.filename).suffix - if dest.suffix != actual_suffix: + # warn if suffixes don't match but ignore .JPG / .jpeg as + # Photo's often converts .JPG to .jpeg + if dest.suffix != actual_suffix and sorted([dest.suffix, actual_suffix]) != [ + ".JPG", + ".jpeg", + ]: logging.warning( f"Invalid destination suffix: {dest.suffix}, should be {actual_suffix}" ) diff --git a/osxphotos/utils.py b/osxphotos/utils.py index 3ed943cb..7f6ace28 100644 --- a/osxphotos/utils.py +++ b/osxphotos/utils.py @@ -218,6 +218,8 @@ def get_last_library_path(): if photosurlref is not None: # use CFURLCreateByResolvingBookmarkData to de-serialize bookmark data into a CFURLRef + # pylint: disable=no-member + # pylint: disable=undefined-variable photosurl = CoreFoundation.CFURLCreateByResolvingBookmarkData( kCFAllocatorDefault, photosurlref, 0, None, None, None, None )