Skip to content

Commit

Permalink
Merge pull request #1 from jb2020-super/bugfix
Browse files Browse the repository at this point in the history
BUG fix. For  PNG images with int type transparency.
  • Loading branch information
nagadomi authored Mar 24, 2021
2 parents 3918004 + c0f1633 commit eab6952
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nunif/utils/image_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def _load_image(im, filename):
meta = {}
im.load()
if im.mode in ("L", "RGB", "P"):
if isinstance(im.info.get('transparency'), bytes):
transparency = im.info.get('transparency')
if isinstance(transparency, bytes) or isinstance(transparency, int):
im = im.convert("RGBA")
if im.mode in ("RGBA", "LA"):
meta["alpha"] = im.getchannel("A")
Expand Down

0 comments on commit eab6952

Please sign in to comment.