mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-11-02 17:07:35 +03:00
Python Imaging Library (Fork)
When getting the size of text with a TransposedFont it was failing:
File "/usr/local/lib/python2.7/site-packages/PIL/ImageDraw.py", line 281, in textsize
return font.getsize(text)
File "/usr/local/lib/python2.7/site-packages/PIL/ImageFont.py", line 189, in getsize
w, h = self.font.getsize(text)[0]
TypeError: 'int' object is not iterable
This is because self.font.getsize(text) returns a (w, h) tuple. To fix, remove the [0].
Test cases have been created in test_imagefont.py:
test_rotated_transposed_font()
test_unrotated_transposed_font()
Both fail before the fix, both pass with the fix. Furthermore, the code I'm using this from ( https://github.com/mattdeboard/word_cloud ) now works as expected and creates a word cloud similar to the ones that PIL created.
|
||
|---|---|---|
| docs | ||
| Images | ||
| libImaging | ||
| PIL | ||
| Sane | ||
| Scripts | ||
| Tests | ||
| Tk | ||
| _imaging.c | ||
| _imagingcms.c | ||
| _imagingft.c | ||
| _imagingmath.c | ||
| _imagingtk.c | ||
| _webp.c | ||
| .gitattributes | ||
| .gitignore | ||
| .travis.yml | ||
| CHANGES.rst | ||
| CONTRIBUTORS.rst | ||
| decode.c | ||
| display.c | ||
| encode.c | ||
| Makefile | ||
| MANIFEST.in | ||
| map.c | ||
| outline.c | ||
| path.c | ||
| py3.h | ||
| README.rst | ||
| selftest.py | ||
| setup.py | ||
| tox.ini | ||
Pillow
======
*Python Imaging Library (Fork)*
Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.
.. image:: https://travis-ci.org/python-imaging/Pillow.png
:target: https://travis-ci.org/python-imaging/Pillow
.. image:: https://pypip.in/v/Pillow/badge.png
:target: https://pypi.python.org/pypi/Pillow/
:alt: Latest PyPI version
.. image:: https://pypip.in/d/Pillow/badge.png
:target: https://pypi.python.org/pypi/Pillow/
:alt: Number of PyPI downloads
The documentation is hosted at http://pillow.readthedocs.org/. It contains installation instructions, tutorials, reference, compatibility details, and more.