summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShyam Sunder <sgsunder1@gmail.com>2022-02-07 12:51:25 -0500
committerShyam Sunder <sgsunder1@gmail.com>2022-02-08 09:58:33 -0500
commita22485afda0a37ac1074f5bfea10828c8fef3151 (patch)
treec0961cc4de6a72b6a3287093581a0c0c2aa7df82
parentd5a6609f754b62536a1d884b0d488adab3ee218e (diff)
server/func/images: upgrade to heif-image-plugin
-rw-r--r--server/Dockerfile2
-rw-r--r--server/requirements.txt14
-rw-r--r--server/szurubooru/func/image_hash.py5
-rw-r--r--server/szurubooru/func/images.py2
4 files changed, 11 insertions, 12 deletions
diff --git a/server/Dockerfile b/server/Dockerfile
index 205c8e4..aac0a65 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -28,9 +28,9 @@ RUN apk --no-cache add \
&& pip3 install --no-cache-dir --disable-pip-version-check \
alembic \
"coloredlogs==5.0" \
+ heif-image-plugin \
youtube_dl \
pillow-avif-plugin \
- pyheif-pillow-opener \
&& apk --no-cache del py3-pip
COPY ./ /opt/app/
diff --git a/server/requirements.txt b/server/requirements.txt
index 2a09b24..6b032d3 100644
--- a/server/requirements.txt
+++ b/server/requirements.txt
@@ -1,14 +1,14 @@
alembic>=0.8.5
-pyyaml>=3.11
-psycopg2-binary>=2.6.1
-SQLAlchemy>=1.0.12, <1.4
-coloredlogs==5.0
certifi>=2017.11.5
+coloredlogs==5.0
+heif-image-plugin>=0.3.2
numpy>=1.8.2
+pillow-avif-plugin>=1.1.0
pillow>=4.3.0
+psycopg2-binary>=2.6.1
pynacl>=1.2.1
-pytz>=2018.3
pyRFC3339>=1.0
-pillow-avif-plugin>=1.1.0
-pyheif-pillow-opener>=0.1.0
+pytz>=2018.3
+pyyaml>=3.11
+SQLAlchemy>=1.0.12, <1.4
youtube_dl
diff --git a/server/szurubooru/func/image_hash.py b/server/szurubooru/func/image_hash.py
index 05b27a4..76d5a84 100644
--- a/server/szurubooru/func/image_hash.py
+++ b/server/szurubooru/func/image_hash.py
@@ -4,16 +4,13 @@ from datetime import datetime
from io import BytesIO
from typing import Any, Callable, List, Optional, Set, Tuple
+import HeifImagePlugin
import numpy as np
import pillow_avif
-import pyheif
from PIL import Image
-from pyheif_pillow_opener import register_heif_opener
from szurubooru import config, errors
-register_heif_opener()
-
logger = logging.getLogger(__name__)
# Math based on paper from H. Chi Wong, Marshall Bern and David Goldberg
diff --git a/server/szurubooru/func/images.py b/server/szurubooru/func/images.py
index 4d4011f..e135d18 100644
--- a/server/szurubooru/func/images.py
+++ b/server/szurubooru/func/images.py
@@ -7,6 +7,8 @@ import subprocess
from io import BytesIO
from typing import List
+import HeifImagePlugin
+import pillow_avif
from PIL import Image as PILImage
from szurubooru import errors