1
0
mirror of https://github.com/ciromattia/kcc synced 2026-07-02 19:15:28 +00:00

WebP support (close #263)

This commit is contained in:
Paweł Jastrzębski
2018-07-08 08:42:34 +02:00
parent a2a405e5f5
commit ef4a91e44d
4 changed files with 9 additions and 7 deletions
+5 -4
View File
@@ -50,7 +50,8 @@ class HTMLStripper(HTMLParser):
def getImageFileName(imgfile):
name, ext = os.path.splitext(imgfile)
ext = ext.lower()
if name.startswith('.') or (ext != '.png' and ext != '.jpg' and ext != '.jpeg' and ext != '.gif'):
if name.startswith('.') or (ext != '.png' and ext != '.jpg' and ext != '.jpeg' and ext != '.gif' and
ext != '.webp'):
return None
return [name, ext]
@@ -146,10 +147,10 @@ def dependencyCheck(level):
missing.append('python-slugify 1.2.1+')
try:
from PIL import __version__ as pillowVersion
if StrictVersion('4.0.0') > StrictVersion(pillowVersion):
missing.append('Pillow 4.0.0+')
if StrictVersion('5.2.0') > StrictVersion(pillowVersion):
missing.append('Pillow 5.2.0+')
except ImportError:
missing.append('Pillow 4.0.0+')
missing.append('Pillow 5.2.0+')
if len(missing) > 0:
print('ERROR: ' + ', '.join(missing) + ' is not installed!')
exit(1)