diff options
Diffstat (limited to 'indoteknik_api/controllers/controller.py')
| -rw-r--r-- | indoteknik_api/controllers/controller.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/controller.py b/indoteknik_api/controllers/controller.py index f777dba8..80f45074 100644 --- a/indoteknik_api/controllers/controller.py +++ b/indoteknik_api/controllers/controller.py @@ -228,6 +228,9 @@ class Controller(http.Controller): image_data = base64.b64decode(image_base64) image = Image.open(BytesIO(image_data)) + if image.format == "PNG" and image.mode != "RGBA": + image = image.convert("RGBA") + # Convert to WebP with BytesIO() as output: image.save(output, format="WEBP", quality=85) |
