1
0
mirror of https://github.com/ciromattia/kcc synced 2026-07-16 01:36:12 +00:00

Fixed detection of file corruption

This commit is contained in:
Paweł Jastrzębski
2015-08-04 09:54:39 +02:00
parent 677622c103
commit 8e5704683c
+1 -1
View File
@@ -986,7 +986,7 @@ def detectCorruption(tmpPath, orgPath):
imageSmaller += 1 imageSmaller += 1
except Exception as err: except Exception as err:
rmtree(os.path.join(tmpPath, '..', '..'), True) rmtree(os.path.join(tmpPath, '..', '..'), True)
if 'decoder' in err and 'not available' in err: if 'decoder' in str(err) and 'not available' in str(err):
raise RuntimeError('Pillow was compiled without JPG and/or PNG decoder.') raise RuntimeError('Pillow was compiled without JPG and/or PNG decoder.')
else: else:
raise RuntimeError('Image file %s is corrupted.' % pathOrg) raise RuntimeError('Image file %s is corrupted.' % pathOrg)