From 48553013f6eca6c51a24e6f2e68b3ed5402a5bdf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 8 Jul 2020 15:32:11 +0100 Subject: [PATCH] Check that file gets copied --- media.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media.py b/media.py index fd372b760..e811fe60e 100644 --- a/media.py +++ b/media.py @@ -38,12 +38,15 @@ def removeMetaData(imageFilename: str, outputFilename: str) -> None: so better to use a dedicated tool if one is installed """ copyfile(imageFilename, outputFilename) + if not os.path.isfile(outputFilename): + print('ERROR: unable to remove metadata from ' + imageFilename) + return if os.path.isfile('/usr/bin/exiftool'): print('Removing metadata from ' + outputFilename + ' using exiftool') os.system('exiftool -all= ' + outputFilename) elif os.path.isfile('/usr/bin/mogrify'): print('Removing metadata from ' + outputFilename + ' using mogrify') - os.system('/usr/bin/mogrify -strip '+outputFilename) + os.system('/usr/bin/mogrify -strip ' + outputFilename) def getImageHash(imageFilename: str) -> str: