Add Redis configuration, integrate Celery, and sort fields in models
All checks were successful
Deploy to Server / deploy (push) Successful in 49s
All checks were successful
Deploy to Server / deploy (push) Successful in 49s
This commit is contained in:
parent
ef2010464c
commit
d99579ed2b
15 changed files with 451 additions and 253 deletions
|
|
@ -345,8 +345,12 @@ class Command(BaseCommand):
|
|||
if img.mode in {"RGBA", "LA"} or (
|
||||
img.mode == "P" and "transparency" in img.info
|
||||
):
|
||||
background: Image = Image.new("RGB", img.size, (255, 255, 255))
|
||||
rgba_img: Image | ImageFile = (
|
||||
background: Image.Image = Image.new(
|
||||
"RGB",
|
||||
img.size,
|
||||
(255, 255, 255),
|
||||
)
|
||||
rgba_img: Image.Image | ImageFile = (
|
||||
img.convert("RGBA") if img.mode == "P" else img
|
||||
)
|
||||
background.paste(
|
||||
|
|
@ -357,9 +361,9 @@ class Command(BaseCommand):
|
|||
)
|
||||
rgb_img = background
|
||||
elif img.mode != "RGB":
|
||||
rgb_img: Image = img.convert("RGB")
|
||||
rgb_img: Image.Image = img.convert("RGB")
|
||||
else:
|
||||
rgb_img: ImageFile = img
|
||||
rgb_img: Image.Image = img
|
||||
|
||||
# Save WebP
|
||||
rgb_img.save(webp_path, "WEBP", quality=85, method=6)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue