alexandrettio / pyfpdf

Automatically exported from code.google.com/p/pyfpdf
GNU Lesser General Public License v3.0
0 stars 0 forks source link

FPDF can avoid "PIL not found" error #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When installing PIL through pip-installing Pillow, no PIL.pth is placed in the 
site-packages directory. 

When no PIL.pth file exists PIL should be used like so:
from PIL import Image

When the PIL.pth does exist, PIL can be used like this:
import Image

(see 
http://stackoverflow.com/questions/8339991/why-in-python-sometimes-from-pil-impo
rt-image-fails-and-import-image-works for more info)

But PFPDF only checks for the latter case:

try:
    # Check if PIL is available, necessary for JPEG support.
    import Image
except ImportError:
    Image = None

It would be convenient if the other case were tested for.

Original issue reported on code.google.com by mjmare31...@gmail.com on 15 Jan 2013 at 9:08

GoogleCodeExporter commented 9 years ago
Thanks you for the report

There is a similar approach in the Issue 34:

http://code.google.com/p/pyfpdf/issues/detail?id=34

Let me know what do you think there (it is pending commit)

Original comment by reingart@gmail.com on 15 Jan 2013 at 3:43