1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-24 15:11:30 +02:00

Removing couple of "buildins" polyglot types

This commit is contained in:
2020-04-20 20:22:50 +02:00
parent eac0b98d6f
commit c867f0321b
36 changed files with 85 additions and 109 deletions
+1 -2
View File
@@ -17,7 +17,6 @@ from ebook_converter.ptempfile import TemporaryDirectory
from ebook_converter.utils.config_base import tweaks
from ebook_converter.utils.filenames import atomic_rename
from ebook_converter.utils.imghdr import what
from ebook_converter.polyglot.builtins import string_or_bytes
# Utilities {{{
# imageops, imageops_err = plugins['imageops']
@@ -505,7 +504,7 @@ def quantize_image(img, max_colors=256, dither=True, palette=''):
img = image_from_data(img)
if img.hasAlphaChannel():
img = blend_image(img)
if palette and isinstance(palette, string_or_bytes):
if palette and isinstance(palette, (str, bytes)):
palette = palette.split()
return imageops.quantize(img, max_colors, dither, [QColor(x).rgb() for x in palette])