Fixed unnecessary warning exporting .JPG to .jpeg

This commit is contained in:
Rhet Turnbull
2020-03-22 08:53:54 -07:00
parent 128a35d6c0
commit aeae1e0b8a
2 changed files with 8 additions and 1 deletions

View File

@@ -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}"
)

View File

@@ -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
)