remove alpha channel on avi
This commit is contained in:
@@ -6,6 +6,7 @@ from flask import (
|
|||||||
from functools import wraps
|
from functools import wraps
|
||||||
from secrets import compare_digest as compare_timesafe
|
from secrets import compare_digest as compare_timesafe
|
||||||
from wand.image import Image
|
from wand.image import Image
|
||||||
|
from wand.color import Color
|
||||||
from wand.exceptions import WandException
|
from wand.exceptions import WandException
|
||||||
from ..auth import (
|
from ..auth import (
|
||||||
digest, verify, create_session,
|
digest, verify, create_session,
|
||||||
@@ -48,6 +49,8 @@ def validate_and_create_avatar(input_image, filename):
|
|||||||
width=crop_size, height=crop_size)
|
width=crop_size, height=crop_size)
|
||||||
|
|
||||||
img.resize(256, 256)
|
img.resize(256, 256)
|
||||||
|
img.background_color = Color('white')
|
||||||
|
img.alpha_channel = 'remove'
|
||||||
img.format = 'webp'
|
img.format = 'webp'
|
||||||
img.compression_quality = 85
|
img.compression_quality = 85
|
||||||
img.save(filename=filename)
|
img.save(filename=filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user