strip animation from uploaded avatar

This commit is contained in:
2025-12-06 18:09:15 +03:00
parent 09a19b5352
commit 37c1ffc2a1

View File

@@ -28,6 +28,8 @@ bp = Blueprint("users", __name__, url_prefix = "/users/")
def validate_and_create_avatar(input_image, filename):
try:
with Image(blob=input_image) as img:
if hasattr(img, 'sequence') and len(img.sequence) > 1:
img = Image(image=img.sequence[0])
img.strip()
img.gravity = 'center'