diff --git a/osxphotos/_version.py b/osxphotos/_version.py index dcbe5303..10af0ddd 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.42.26" +__version__ = "0.42.27" diff --git a/osxphotos/utils.py b/osxphotos/utils.py index f42734f6..0c857975 100644 --- a/osxphotos/utils.py +++ b/osxphotos/utils.py @@ -268,14 +268,23 @@ def list_photo_libraries(): def get_preferred_uti_extension(uti): """ get preferred extension for a UTI type uti: UTI str, e.g. 'public.jpeg' - returns: preferred extension as str """ + returns: preferred extension as str or None if cannot be determined """ # reference: https://developer.apple.com/documentation/coreservices/1442744-uttypecopypreferredtagwithclass?language=objc with objc.autorelease_pool(): - return CoreServices.UTTypeCopyPreferredTagWithClass( + extension = CoreServices.UTTypeCopyPreferredTagWithClass( uti, CoreServices.kUTTagClassFilenameExtension ) + if extension: + return extension + + # on MacOS 10.12, HEIC files are not supported and UTTypeCopyPreferredTagWithClass will return None for HEIC + if uti == "public.heic": + return "HEIC" + + return None + def findfiles(pattern, path_): """Returns list of filenames from path_ matched by pattern