Unconditionally import turbojpeg from camera (#141995)

This commit is contained in:
Erik Montnemery 2025-04-01 14:24:15 +02:00 committed by GitHub
parent 145e02769c
commit fa9613a879
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,17 +2,10 @@
from __future__ import annotations from __future__ import annotations
from contextlib import suppress
import logging import logging
from typing import TYPE_CHECKING, Literal, cast from typing import TYPE_CHECKING, Literal, cast
with suppress(Exception): from turbojpeg import TurboJPEG
# TurboJPEG imports numpy which may or may not work so
# we have to guard the import here. We still want
# to import it at top level so it gets loaded
# in the import executor and not in the event loop.
from turbojpeg import TurboJPEG
if TYPE_CHECKING: if TYPE_CHECKING:
from . import Image from . import Image