aboutsummaryrefslogtreecommitdiff
path: root/www/seahub
diff options
context:
space:
mode:
authorRichard Gallamore <ultima@FreeBSD.org>2023-08-26 17:24:40 +0000
committerRichard Gallamore <ultima@FreeBSD.org>2023-08-26 17:24:40 +0000
commitffaa8cd925c26ff03e8d7e358b9fa54e774a9db5 (patch)
tree9ed1c52f66d4ace793c8954919da93db98f390ad /www/seahub
parent9549a20a0be5687d170dc419de5e5c8f1026af8c (diff)
downloadports-ffaa8cd925c26ff03e8d7e358b9fa54e774a9db5.tar.gz
ports-ffaa8cd925c26ff03e8d7e358b9fa54e774a9db5.zip
www/seahub: Patch for new version of Pillow
PR: 272942 Reported by: Scott Kitchin (scott@kitchin.com), Boris Tassou (boris.tassou@securmail.fr) Submitted by: sunpoet Obtained from: Seafile
Diffstat (limited to 'www/seahub')
-rw-r--r--www/seahub/Makefile3
-rw-r--r--www/seahub/files/patch-pillow50
2 files changed, 52 insertions, 1 deletions
diff --git a/www/seahub/Makefile b/www/seahub/Makefile
index d4faf16db76a..2ad0d93ce723 100644
--- a/www/seahub/Makefile
+++ b/www/seahub/Makefile
@@ -2,6 +2,7 @@ PORTNAME= seahub
DISTVERSIONPREFIX= v
DISTVERSION= ${SEAHUB_VER}
DISTVERSIONSUFFIX= -server
+PORTREVISION= 1
CATEGORIES= www
MAINTAINER= ultima@FreeBSD.org
@@ -29,7 +30,7 @@ RUN_DEPENDS= bash:shells/bash \
${PYTHON_PKGNAMEPREFIX}djangorestframework>=0:www/py-djangorestframework@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}dateutil>=0:devel/py-dateutil@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}requests>=0:www/py-requests@${PY_FLAVOR} \
- ${PY_PILLOW} \
+ ${PYTHON_PKGNAMEPREFIX}pillow>=0:graphics/py-pillow@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pyjwt>=0:www/py-pyjwt@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pycryptodome>=3.12.0:security/py-pycryptodome@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}requests-oauthlib>=0:www/py-requests-oauthlib@${PY_FLAVOR} \
diff --git a/www/seahub/files/patch-pillow b/www/seahub/files/patch-pillow
new file mode 100644
index 000000000000..b4fae5571f32
--- /dev/null
+++ b/www/seahub/files/patch-pillow
@@ -0,0 +1,50 @@
+Obtained from: https://github.com/haiwen/seahub/commit/cbe0817f2bee0c2b00d3ffd3e047c3141862c6c5
+
+--- seahub/avatar/settings.py.orig 2022-11-30 03:34:16 UTC
++++ seahub/avatar/settings.py
+@@ -22,7 +22,7 @@ AUTO_GENERATE_GROUP_AVATAR_SIZES = getattr(settings, '
+
+ ### Common settings ###
+ AVATAR_FILE_STORAGE = getattr(settings, 'AVATAR_FILE_STORAGE', '')
+-AVATAR_RESIZE_METHOD = getattr(settings, 'AVATAR_RESIZE_METHOD', Image.ANTIALIAS)
++AVATAR_RESIZE_METHOD = getattr(settings, 'AVATAR_RESIZE_METHOD', Image.Resampling.LANCZOS)
+ AVATAR_GRAVATAR_BACKUP = getattr(settings, 'AVATAR_GRAVATAR_BACKUP', True)
+ AVATAR_GRAVATAR_DEFAULT = getattr(settings, 'AVATAR_GRAVATAR_DEFAULT', None)
+ AVATAR_MAX_AVATARS_PER_USER = getattr(settings, 'AVATAR_MAX_AVATARS_PER_USER', 42)
+--- seahub/thumbnail/utils.py.orig 2022-11-30 03:34:16 UTC
++++ seahub/thumbnail/utils.py
+@@ -54,22 +54,22 @@ def get_rotated_image(image):
+
+ if orientation == 2:
+ # Vertical image
+- image = image.transpose(Image.FLIP_LEFT_RIGHT)
++ image = image.transpose(Image.Transpose.FLIP_LEFT_RIGHT)
+ elif orientation == 3:
+ # Rotation 180
+ image = image.rotate(180)
+ elif orientation == 4:
+- image = image.rotate(180).transpose(Image.FLIP_LEFT_RIGHT)
++ image = image.rotate(180).transpose(Image.Transpose.FLIP_LEFT_RIGHT)
+ # Horizontal image
+ elif orientation == 5:
+ # Horizontal image + Rotation 90 CCW
+- image = image.rotate(-90, expand=True).transpose(Image.FLIP_LEFT_RIGHT)
++ image = image.rotate(-90, expand=True).transpose(Image.Transpose.FLIP_LEFT_RIGHT)
+ elif orientation == 6:
+ # Rotation 270
+ image = image.rotate(-90, expand=True)
+ elif orientation == 7:
+ # Horizontal image + Rotation 270
+- image = image.rotate(90, expand=True).transpose(Image.FLIP_LEFT_RIGHT)
++ image = image.rotate(90, expand=True).transpose(Image.Transpose.FLIP_LEFT_RIGHT)
+ elif orientation == 8:
+ # Rotation 90
+ image = image.rotate(90, expand=True)
+@@ -230,7 +230,7 @@ def _create_thumbnail_common(fp, thumbnail_file, size)
+ image = image.convert("RGB")
+
+ image = get_rotated_image(image)
+- image.thumbnail((size, size), Image.ANTIALIAS)
++ image.thumbnail((size, size), Image.Resampling.LANCZOS)
+ image.save(thumbnail_file, THUMBNAIL_EXTENSION)
+ return (True, 200)