From 37e8fa5e09836f492c124bdc04e280fc53966790 Mon Sep 17 00:00:00 2001 From: geisserml Date: Sat, 24 Sep 2022 14:31:09 +0200 Subject: [PATCH] CLI: optional HEIF support --- src/img2pdf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/img2pdf.py b/src/img2pdf.py index ed5a6f3..b84004b 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -4224,6 +4224,17 @@ and left/right, respectively. It is not possible to specify asymmetric borders. if args.verbose: 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: Image.MAX_IMAGE_PIXELS = None -- 2.39.5