From e7a07377efd1fd1d7384d6d82cf8e8eb0b60d2af Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Wed, 9 Jul 2025 11:27:58 -0700 Subject: [PATCH] add avif input support (#1019) * add avif input support * add avif --- environment.yml | 2 +- kindlecomicconverter/comic2ebook.py | 2 +- kindlecomicconverter/shared.py | 6 +++--- requirements.txt | 2 +- setup.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/environment.yml b/environment.yml index 24b702a..0a9ba52 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - defaults dependencies: - python=3.11 - - Pillow>=5.2.0 + - Pillow>=11.3.0 - psutil>=5.9.5 - python-slugify>=1.2.1 - raven>=6.0.0 diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 1b9dc83..eaf2074 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -820,7 +820,7 @@ def removeNonImages(filetree): for root, dirs, files in os.walk(filetree): for name in files: _, ext = getImageFileName(name) - if ext not in ('.png', '.jpg', '.jpeg', '.gif', '.webp', '.jp2'): + if ext not in ('.png', '.jpg', '.jpeg', '.gif', '.webp', '.jp2', '.avif'): if os.path.exists(os.path.join(root, name)): os.remove(os.path.join(root, name)) # remove empty nested folders diff --git a/kindlecomicconverter/shared.py b/kindlecomicconverter/shared.py index 3993391..1a4c1b3 100644 --- a/kindlecomicconverter/shared.py +++ b/kindlecomicconverter/shared.py @@ -116,10 +116,10 @@ def dependencyCheck(level): missing.append('python-slugify 1.2.1+') try: from PIL import __version__ as pillowVersion - if Version('5.2.0') > Version(pillowVersion): - missing.append('Pillow 5.2.0+') + if Version('11.3.0') > Version(pillowVersion): + missing.append('Pillow 11.3.0+') except ImportError: - missing.append('Pillow 5.2.0+') + missing.append('Pillow 11.3.0+') if len(missing) > 0: print('ERROR: ' + ', '.join(missing) + ' is not installed!') sys.exit(1) diff --git a/requirements.txt b/requirements.txt index 8d0e11a..edee66a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ PySide6>=6.5.1 -Pillow>=5.2.0 +Pillow>=11.3.0 psutil>=5.9.5 requests>=2.31.0 python-slugify>=1.2.1 diff --git a/setup.py b/setup.py index 13a36b0..b2cc1ed 100644 --- a/setup.py +++ b/setup.py @@ -75,7 +75,7 @@ setuptools.setup( packages=['kindlecomicconverter'], install_requires=[ 'pyside6>=6.5.1', - 'Pillow>=5.2.0', + 'Pillow>=11.3.0', 'psutil>=5.9.5', 'python-slugify>=1.2.1,<9.0.0', 'raven>=6.0.0', @@ -83,7 +83,7 @@ setuptools.setup( 'mozjpeg-lossless-optimization>=1.1.2', 'natsort>=8.4.0', 'distro', - 'numpy>=1.22.4,<2.0.0' + 'numpy>=1.22.4' ], classifiers=[], zip_safe=False,