mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 12:17:14 +03:00
ad784eb808
This is Christoph Gohlke's test suite from his personal PIL package found at http://www.lfd.uci.edu/~gohlke/pythonlibs/. This is just to bring it in as a separate commit. Future commits will align it with Pillow.
15 lines
326 B
Python
15 lines
326 B
Python
from PIL import Image, ImageFont, ImageDraw
|
|
|
|
font = "../pil-archive/memory-error-2.ttf"
|
|
|
|
s = "Test Text"
|
|
f = ImageFont.truetype(font, 64, index=0, encoding="unicode")
|
|
w, h = f.getsize(s)
|
|
i = Image.new("RGB", (500, h), "white")
|
|
d = ImageDraw.Draw(i)
|
|
|
|
# this line causes a MemoryError
|
|
d.text((0,0), s, font=f, fill=0)
|
|
|
|
i.show()
|