From 047cbe54627b5a7f5d721b9db81c65965a2fb6d3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 28 Dec 2023 23:04:28 -0500 Subject: [PATCH] fix blurhash when sharing wrapped summary --- takahe/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/takahe/utils.py b/takahe/utils.py index 1e82630f..e5af2635 100644 --- a/takahe/utils.py +++ b/takahe/utils.py @@ -1,7 +1,7 @@ import io from typing import TYPE_CHECKING -# import blurhash +import blurhash from django.conf import settings from django.core.cache import cache from django.core.files.images import ImageFile @@ -416,7 +416,7 @@ class Takahe: new_image_bytes = io.BytesIO() resized_image.save(new_image_bytes, format="webp", save_all=True) thumbnail_file = ImageFile(new_image_bytes, name="image.webp") - # hash = blurhash.encode(resized_image, 4, 4) + hash = blurhash.encode(resized_image, 4, 4) attachment = PostAttachment.objects.create( mimetype=mimetype, width=main_file.width, @@ -426,7 +426,7 @@ class Takahe: author_id=author_pk, file=main_file, thumbnail=thumbnail_file, - # blurhash=hash, + blurhash=hash, ) attachment.save() return attachment