cope with unusual image modes

workspace
Brendan Howell 8 years ago
parent 83a92c6f5e
commit b52c07322c

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

Loading…
Cancel
Save