Skip to content

Commit

Permalink
fix[backend]: convert to RGB if ingredient returned image with non-…
Browse files Browse the repository at this point in the history
…RGB mode
  • Loading branch information
darmiel committed Nov 4, 2023
1 parent 38366dc commit 9858d8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def upload():
img = run_action(ingredient.identifier, ingredient.options, img)
except Exception as exception:
return abort(400, exception)
if img.mode != "RGB":
img = img.convert("RGB")

# add watermark (if enabled)
img = watermark.paint(img)
Expand Down

0 comments on commit 9858d8a

Please sign in to comment.