CLI: optional HEIF support

This commit is contained in:
geisserml 2022-09-24 14:31:09 +02:00
parent 10c6901fa3
commit 37e8fa5e09

View file

@ -4224,6 +4224,17 @@ and left/right, respectively. It is not possible to specify asymmetric borders.
if args.verbose: if args.verbose:
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
# optional support for HEIF/HEIC via Pillow plugin
# only for the CLI to let library users choose on their own
# https://gitlab.mister-muffin.de/josch/img2pdf/issues/105
# https://github.com/python-pillow/Pillow/issues/2806
try:
import pillow_heif
except ImportError:
pass
else:
pillow_heif.register_heif_opener()
if args.pillow_limit_break: if args.pillow_limit_break:
Image.MAX_IMAGE_PIXELS = None Image.MAX_IMAGE_PIXELS = None