about summary refs log tree commit diff
path: root/kindlecomicconverter
diff options
context:
space:
mode:
authorPaweł Jastrzębski <pawelj@iosphe.re>2018-07-08 08:42:34 +0200
committerPaweł Jastrzębski <pawelj@iosphe.re>2018-07-08 08:42:34 +0200
commitef4a91e44d03506e24e6255e09540226b33d5791 (patch)
treed2c6084cf4aac805e6e3923f02089ca6d18ab217 /kindlecomicconverter
parentMerge branch 'Gokuroro-master' into dev (diff)
downloadkcc-ef4a91e44d03506e24e6255e09540226b33d5791.tar.gz
kcc-ef4a91e44d03506e24e6255e09540226b33d5791.tar.bz2
kcc-ef4a91e44d03506e24e6255e09540226b33d5791.zip
WebP support (close #263)
Diffstat (limited to 'kindlecomicconverter')
-rwxr-xr-xkindlecomicconverter/comic2ebook.py3
-rw-r--r--kindlecomicconverter/shared.py9
2 files changed, 7 insertions, 5 deletions
diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py
index b560825..e118b7e 100755
--- a/kindlecomicconverter/comic2ebook.py
+++ b/kindlecomicconverter/comic2ebook.py
@@ -790,7 +790,8 @@ def splitDirectory(path):
     level = -1
     for root, _, files in os.walk(os.path.join(path, 'OEBPS', 'Images')):
         for f in files:
-            if f.endswith('.jpg') or f.endswith('.jpeg') or f.endswith('.png') or f.endswith('.gif'):
+            if f.endswith('.jpg') or f.endswith('.jpeg') or f.endswith('.png') or f.endswith('.gif') or \
+                    f.endswith('.webp'):
                 newLevel = os.path.join(root, f).replace(os.path.join(path, 'OEBPS', 'Images'), '').count(os.sep)
                 if level != -1 and level != newLevel:
                     level = 0
diff --git a/kindlecomicconverter/shared.py b/kindlecomicconverter/shared.py
index 39c3613..bdfd3e7 100644
--- a/kindlecomicconverter/shared.py
+++ b/kindlecomicconverter/shared.py
@@ -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)