strip animation from uploaded avatar
This commit is contained in:
@@ -28,6 +28,8 @@ bp = Blueprint("users", __name__, url_prefix = "/users/")
|
|||||||
def validate_and_create_avatar(input_image, filename):
|
def validate_and_create_avatar(input_image, filename):
|
||||||
try:
|
try:
|
||||||
with Image(blob=input_image) as img:
|
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.strip()
|
||||||
img.gravity = 'center'
|
img.gravity = 'center'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user