Check that file gets copied

merge-requests/8/head
Bob Mottram 2020-07-08 15:32:11 +01:00
parent 6fbba92427
commit 48553013f6
1 changed files with 4 additions and 1 deletions

View File

@ -38,12 +38,15 @@ def removeMetaData(imageFilename: str, outputFilename: str) -> None:
so better to use a dedicated tool if one is installed so better to use a dedicated tool if one is installed
""" """
copyfile(imageFilename, outputFilename) 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'): if os.path.isfile('/usr/bin/exiftool'):
print('Removing metadata from ' + outputFilename + ' using exiftool') print('Removing metadata from ' + outputFilename + ' using exiftool')
os.system('exiftool -all= ' + outputFilename) os.system('exiftool -all= ' + outputFilename)
elif os.path.isfile('/usr/bin/mogrify'): elif os.path.isfile('/usr/bin/mogrify'):
print('Removing metadata from ' + outputFilename + ' using 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: def getImageHash(imageFilename: str) -> str: