From b3cfccb9c091eaa997a12f080be6d6d40dce8972 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Fri, 23 Jun 2023 09:37:30 +0200 Subject: [PATCH 1/5] Since prod is on 36, use 36 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2f68d67..2674bf1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/rhn_support_ofalk/fedora37-python3 +FROM quay.io/rhn_support_ofalk/fedora36-python3 LABEL maintainer Oliver Falk EXPOSE 8081 From 9faf308264befc16d1cc22fcff58f86a18814f53 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Fri, 23 Jun 2023 10:18:10 +0200 Subject: [PATCH 2/5] Move back to f37, we want devel to be on latest --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2674bf1..2f68d67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/rhn_support_ofalk/fedora36-python3 +FROM quay.io/rhn_support_ofalk/fedora37-python3 LABEL maintainer Oliver Falk EXPOSE 8081 From b7efc60cc0ce81ea46aea17c25730cbe6bee2840 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Fri, 23 Jun 2023 10:19:44 +0200 Subject: [PATCH 3/5] Prod on f36, so move to f36 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afd91da..dc9a744 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ image: - name: quay.io/rhn_support_ofalk/fedora35-python3 + name: quay.io/rhn_support_ofalk/fedora36-python3 entrypoint: - "/bin/sh" - "-c" From 4f239119d66f731794c3424d3cb2430cdc1c5618 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Tue, 12 Sep 2023 16:15:16 +0200 Subject: [PATCH 4/5] Disable image building for the moment until we figured out why it's not working --- .gitlab-ci.yml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dc9a744..1d21963 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,28 +66,28 @@ pages: expire_in: 14 days only: - master -build-image: - image: docker - only: - - master - - devel - services: - - docker:dind - before_script: - - docker info - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - ls -lah - - | - if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then - tag="" - echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" - else - tag=":$CI_COMMIT_REF_SLUG" - echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" - fi - - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" +#build-image: +# image: docker +# only: +# - master +# - devel +# services: +# - docker:dind +# before_script: +# - docker info +# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY +# script: +# - ls -lah +# - | +# if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then +# tag="" +# echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" +# else +# tag=":$CI_COMMIT_REF_SLUG" +# echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" +# fi +# - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . +# - docker push "$CI_REGISTRY_IMAGE${tag}" semgrep: stage: test allow_failure: true From b58c35e98b98debcd9c71572b343d2468ef6f942 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Tue, 12 Sep 2023 16:35:51 +0200 Subject: [PATCH 5/5] Pillow 10.0.0 removed the ANTIALIAS alias. --- ivatar/ivataraccount/models.py | 2 +- ivatar/views.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ivatar/ivataraccount/models.py b/ivatar/ivataraccount/models.py index b201f61..cee3bfb 100644 --- a/ivatar/ivataraccount/models.py +++ b/ivatar/ivataraccount/models.py @@ -266,7 +266,7 @@ class Photo(BaseAccountModel): cropped_w, cropped_h = cropped.size max_w = AVATAR_MAX_SIZE if cropped_w > max_w or cropped_h > max_w: - cropped = cropped.resize((max_w, max_w), Image.ANTIALIAS) + cropped = cropped.resize((max_w, max_w), Image.LANCZOS) data = BytesIO() cropped.save(data, pil_format(self.format), quality=JPEG_QUALITY) diff --git a/ivatar/views.py b/ivatar/views.py index 462ceb9..bf4394d 100644 --- a/ivatar/views.py +++ b/ivatar/views.py @@ -256,7 +256,7 @@ class AvatarImageView(TemplateView): identicon = Identicon.render(kwargs["digest"]) data = BytesIO() img = Image.open(BytesIO(identicon)) - img = img.resize((size, size), Image.ANTIALIAS) + img = img.resize((size, size), Image.LANCZOS) img.save(data, "PNG", quality=JPEG_QUALITY) data.seek(0) response = CachingHttpResponse(uri, data, content_type="image/png") @@ -266,7 +266,7 @@ class AvatarImageView(TemplateView): if str(default) == "pagan": paganobj = pagan.Avatar(kwargs["digest"]) data = BytesIO() - img = paganobj.img.resize((size, size), Image.ANTIALIAS) + img = paganobj.img.resize((size, size), Image.LANCZOS) img.save(data, "PNG", quality=JPEG_QUALITY) data.seek(0) response = CachingHttpResponse(uri, data, content_type="image/png") @@ -331,9 +331,9 @@ class AvatarImageView(TemplateView): # If the image is smaller than what was requested, we need # to use the function resize if photodata.size[0] < size or photodata.size[1] < size: - photodata = photodata.resize((size, size), Image.ANTIALIAS) + photodata = photodata.resize((size, size), Image.LANCZOS) else: - photodata.thumbnail((size, size), Image.ANTIALIAS) + photodata.thumbnail((size, size), Image.LANCZOS) photodata.save(data, pil_format(imgformat), quality=JPEG_QUALITY) data.seek(0)