10 Commits

Author SHA1 Message Date
Oliver Falk
3a61d519ba Add example issue template 2023-09-12 16:56:58 +02:00
Oliver Falk
8dff034f9e Merge branch 'devel' into 'master'
Pull in latest developments

See merge request oliver/ivatar!230
2023-09-12 14:54:33 +00:00
Oliver Falk
b58c35e98b Pillow 10.0.0 removed the ANTIALIAS alias. 2023-09-12 16:35:51 +02:00
Oliver Falk
4f239119d6 Disable image building for the moment until we figured out why it's not working 2023-09-12 16:15:16 +02:00
Oliver Falk
b7efc60cc0 Prod on f36, so move to f36 2023-06-23 10:19:44 +02:00
Oliver Falk
9faf308264 Move back to f37, we want devel to be on latest 2023-06-23 10:18:10 +02:00
Oliver Falk
b3cfccb9c0 Since prod is on 36, use 36 2023-06-23 09:37:30 +02:00
Oliver Falk
5a1dfbc459 Merge branch 'devel' into 'master'
Update CI config for sec. scanning

See merge request oliver/ivatar!229
2023-05-16 07:11:53 +00:00
Oliver Falk
4385fcc034 Merge branch 'devel' into 'master'
Ensure working CI setup that passes the CI test

See merge request oliver/ivatar!227
2023-05-09 11:31:05 +00:00
Oliver Falk
fa4ce5e079 Merge branch 'devel' into 'master'
Reverse mr !121, since we have a b0kren ci/cd setup it seems

See merge request oliver/ivatar!225
2023-04-20 06:45:59 +00:00
4 changed files with 36 additions and 29 deletions

View File

@@ -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"
@@ -66,33 +66,35 @@ 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:
extends: semgrep-sast
stage: test
allow_failure: true
image: registry.gitlab.com/gitlab-org/security-products/analyzers/semgrep:latest
only:
- master
- devel
variables:
CI_PROJECT_DIR: "/tmp/app"
SECURE_LOG_LEVEL: "debug"

View File

@@ -0,0 +1,5 @@
# Dscribe your issue
# What have you tried to far?
# Links / Pointer / Resources

View File

@@ -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)

View File

@@ -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)