Open pieman2201 opened 3 years ago
I may (?) have further insight into the issue. Upon trying the same code multiple more times, I ran into the following Python error and segfault:
>>> import wordcloud
>>> wordcloud.WordCloud(width = 800, height = 800).generate("hi hi hi hi hi hi hi hi hi hi hi h ih i hvfjdksnfdjkl f dsg fdsg fdsg").to_svg(embed_font = True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ishan/docs/code/html/personal-site/venv/lib/python3.9/site-packages/wordcloud/wordcloud.py", line 632, in generate
return self.generate_from_text(text)
File "/home/ishan/docs/code/html/personal-site/venv/lib/python3.9/site-packages/wordcloud/wordcloud.py", line 614, in generate_from_text
self.generate_from_frequencies(words)
File "/home/ishan/docs/code/html/personal-site/venv/lib/python3.9/site-packages/wordcloud/wordcloud.py", line 446, in generate_from_frequencies
self.generate_from_frequencies(dict(frequencies[:2]),
File "/home/ishan/docs/code/html/personal-site/venv/lib/python3.9/site-packages/wordcloud/wordcloud.py", line 501, in generate_from_frequencies
box_size = draw.textsize(word, font=transposed_font)
File "/home/ishan/docs/code/html/personal-site/venv/lib/python3.9/site-packages/PIL/ImageDraw.py", line 479, in textsize
return font.getsize(text, direction, features, language, stroke_width)
File "/home/ishan/docs/code/html/personal-site/venv/lib/python3.9/site-packages/PIL/ImageFont.py", line 769, in getsize
w, h = self.font.getsize(text)
File "/home/ishan/docs/code/html/personal-site/venv/lib/python3.9/site-packages/PIL/ImageFont.py", line 430, in getsize
size, offset = self.font.getsize(text, "L", direction, features, language)
OSError: invalid face handle
>>>
Segmentation fault (core dumped)
This might be related to #516? Whta version of pil do you have?
Description
Segfaults / memory errors seemingly at random? I ran the same code 4 times: each trial produced a different result. I restarted the Python interpreter between trials.
Steps/Code to Reproduce
Expected Results
A wordcloud svg as a string output
Actual Results
Trial 1
Trial 2
Of the 4 trials with the exact same input, this was the only one to actually return a string.
Trial 3
Trial 4
Versions