Skip to content

Commit

Permalink
fix: image with non-RGB mode will not be handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceGin committed Jul 11, 2019
1 parent 9140236 commit a22aa7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions haishoku/haillow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def get_image(image_path):
image_path = io.BytesIO(urllib.request.urlopen(image_path).read())

image = Image.open(image_path)

# convert non-RGB mode to RGB mode
if image.mode != "RGB":
image = image.convert("RGB")
return image

def get_thumbnail(image):
Expand Down

0 comments on commit a22aa7d

Please sign in to comment.