summaryrefslogtreecommitdiff
path: root/textproc/py-ocrmypdf/files/patch-src_ocrmypdf___pipeline.py
blob: 4e6d39914ddbb2631eee5e51fb3ef844f71a0205 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Fallback to pillow_heif if pi_heif is not present.

--- src/ocrmypdf/_pipeline.py.orig	2024-06-15 08:09:59 UTC
+++ src/ocrmypdf/_pipeline.py
@@ -45,8 +45,12 @@ except ImportError:
     from pi_heif import register_heif_opener
 except ImportError:
 
-    def register_heif_opener():
-        pass
+    try:
+        from pillow_heif import register_heif_opener
+    except ImportError:
+
+        def register_heif_opener():
+            pass
 
 
 T = TypeVar("T")