Skip to content

Commit

Permalink
BUG fix. For PNG images with int type transparency.
Browse files Browse the repository at this point in the history
  • Loading branch information
jb2020-super committed Mar 24, 2021
1 parent 3918004 commit c0f1633
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 c0f1633

Please sign in to comment.