Skip to content

Commit 6b10a3b

Browse files
committed
fix: turbo-jpeg fallback
1 parent 7d4cb86 commit 6b10a3b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

trame_rca/utils.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222

2323
try:
2424
from trame_rca.encoders.turbo_jpeg import encode as encode_turbo
25-
except ImportError:
26-
print("Turbo JPEG - NOT AVAILABLE")
25+
except RuntimeError:
26+
print("Turbo JPEG - NOT AVAILABLE (System Library)")
27+
encode_turbo = encode_pil
28+
except ModuleNotFoundError:
29+
print("Turbo JPEG - NOT AVAILABLE (Python package)")
2730
encode_turbo = encode_pil
2831

2932
ENCODING_POOL = ThreadPoolExecutor(max(4, os.cpu_count()))

0 commit comments

Comments
 (0)