alexandrettio / pyfpdf

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

Pillow and other corrected PIL forks support. #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install Pillow instead of PIL, through pypi
2. do any operation involving pyfpdf
3. pyfpdf throws an exception saying that it can't find any package named 
"Image"

What is the expected output? What do you see instead?
The expected output is for the operation to go through an continue.

What version of the product are you using? On what operating system?
Latest copy from pypi. Ubuntu 11.10

Please provide any additional information below.
My understanding is that PIL doesn't directly support setup-tools or the like, 
even though it is on pypi. Your code supports the pypi version of PIL by just 
using "import Image", when it really should be "from PIL import Image" (which 
sadly does't with on the pypi version). The code, in turn, does not work with 
Pillow, and (though I haven't tested this yet) it won't work with manually 
installed or corrected versions of PIL.

The catch-all solution is to use one more try/except so that it tries importing 
PIL both ways. I have included a patch file with my changes.

Original issue reported on code.google.com by hardy.ke...@gmail.com on 7 Dec 2012 at 11:09

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here's the patch.

Original comment by hardy.ke...@gmail.com on 7 Dec 2012 at 11:18

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, do you want to commit yourself?
I've given you commit access.

Original comment by reingart@gmail.com on 8 Dec 2012 at 3:52

GoogleCodeExporter commented 9 years ago
Issue 40 has been merged into this issue.

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

GoogleCodeExporter commented 9 years ago
Indeed, issue 40 is the same problem and indicates the problem. The proposed 
patch will solve this.

Original comment by mjmare31...@gmail.com on 15 Jan 2013 at 5:51

GoogleCodeExporter commented 9 years ago
ok, the patch is commited, could you test it? thanks

Original comment by reingart@gmail.com on 15 Jan 2013 at 11:09

GoogleCodeExporter commented 9 years ago
Seems to work

Original comment by mjmare31...@gmail.com on 16 Jan 2013 at 9:06

GoogleCodeExporter commented 9 years ago
Thanks!

Original comment by reingart@gmail.com on 16 Jan 2013 at 2:57

GoogleCodeExporter commented 9 years ago
Noob question: How can I add this patch to my FPDF already installed library? 
Should I just edit the /usr/bin/phyton2.6/site-packages/fpdf/fpdf.py? If so, 
after editing the file should I compile it again?

Thanks

Original comment by rcornej...@gmail.com on 23 Jul 2014 at 8:33

GoogleCodeExporter commented 9 years ago
Yes, you can change fpdf.py directly. Remember to delete any compiled/optimized 
file (.pyc / .pyo so it get compiled again).
If it is under usr bin , you would need to do this as an administrator (root, 
with sudo / su)

Original comment by reingart@gmail.com on 23 Jul 2014 at 8:55

GoogleCodeExporter commented 9 years ago
thanks

Original comment by rcornej...@gmail.com on 24 Jul 2014 at 3:31