chore(thumbs): prepare for pillow_heif removing AVIF support (#1065)

* fix(thumb_renderer): prepare for pillow_heif removing AVIF support

* fix(nix/package): add pillow-avif-plugin
This commit is contained in:
Xarvex
2025-08-29 20:05:40 -04:00
committed by GitHub
parent 8e1ae81ec9
commit 2926b91980
3 changed files with 6 additions and 3 deletions

View File

@@ -74,6 +74,7 @@ python3Packages.buildPythonApplication {
pythonRelaxDeps = [
"numpy"
"pillow"
"pillow-avif-plugin"
"pillow-heif"
"pillow-jxl-plugin"
"pyside6"
@@ -93,6 +94,7 @@ python3Packages.buildPythonApplication {
numpy
opencv-python
pillow
pillow-avif-plugin
pillow-heif
pydantic
pydub

View File

@@ -16,7 +16,8 @@ dependencies = [
"mutagen~=1.47",
"numpy~=2.2",
"opencv_python~=4.11",
"Pillow>=10.2,<=12.0",
"Pillow>=10.2,<=11",
"pillow-avif-plugin~=1.5",
"pillow-heif~=0.22",
"pillow-jxl-plugin~=1.3",
"pydantic~=2.10",

View File

@@ -16,6 +16,7 @@ from warnings import catch_warnings
import cv2
import numpy as np
import pillow_avif # noqa: F401 # pyright: ignore[reportUnusedImport]
import rawpy
import srctools
import structlog
@@ -33,7 +34,7 @@ from PIL import (
UnidentifiedImageError,
)
from PIL.Image import DecompressionBombError
from pillow_heif import register_avif_opener, register_heif_opener
from pillow_heif import register_heif_opener
from PySide6.QtCore import (
QBuffer,
QFile,
@@ -79,7 +80,6 @@ os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1"
logger = structlog.get_logger(__name__)
Image.MAX_IMAGE_PIXELS = None
register_heif_opener()
register_avif_opener()
try:
import pillow_jxl # noqa: F401 # pyright: ignore[reportUnusedImport]