1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +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

View File

@@ -986,7 +986,7 @@ def detectCorruption(tmpPath, orgPath):
imageSmaller += 1
except Exception as err:
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.')
else:
raise RuntimeError('Image file %s is corrupted.' % pathOrg)