From e9d49c91b0974324a3e16cd246a91b05ee3c9df3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 6 Mar 2021 23:03:14 +0000 Subject: [PATCH] Check that media file exists --- media.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media.py b/media.py index eb0df3d43..66b6823e3 100644 --- a/media.py +++ b/media.py @@ -54,6 +54,10 @@ def removeMetaData(imageFilename: str, outputFilename: str) -> None: def _isMedia(imageFilename: str) -> bool: + """Is the given file a media file? + """ + if not os.path.isfile(_isMedia): + return False permittedMedia = getMediaExtensions() for m in permittedMedia: if imageFilename.endswith('.' + m):