cope with unusual image modes

workspace
Brendan Howell 8 years ago
parent 83a92c6f5e
commit b52c07322c

@ -113,7 +113,8 @@ class PublicRelations(Bureau):
print("fetching", i_url, filename) print("fetching", i_url, filename)
urllib.request.urlretrieve(i_url, filename) urllib.request.urlretrieve(i_url, filename)
im = PIL.Image.open(filename) im = PIL.Image.open(filename)
im = PIL.ImageOps.equalize(im) if im.mode in ("L", "RGB", "P"):
im = PIL.ImageOps.equalize(im)
im.thumbnail((576, 576), PIL.Image.ANTIALIAS) im.thumbnail((576, 576), PIL.Image.ANTIALIAS)
prn.image(im, impl="bitImageColumn") prn.image(im, impl="bitImageColumn")

Loading…
Cancel
Save