I was using the zope server to generate barcode images using PIL, and
found one of my PIL methods was throwing a python error when used in Zope (from an external method), but not otherwise.
The error is a follows:
Error Type: AttributeError
Error Value: 'module' object has no attribute '_save'
The reason for this is that JpegImagePlugin.py
called a module called ImageFile from the PIL library, but Zope also defined a (different) module called ImageFile. Argh!!
Fixing this (for me) involved going into JpegImagePlugin.py
and replacing the line "import ImageFile"
with "from PIL import ImageFile".
A quick fix that took a very long time to track down. This solution is provided here to help the next hapless soul who tries Googling for this error like I did. Now there is at least one solution out here, instead of just queries.
You can see the fixed method in action at
http://www.dudek.org/Barcodes/barcode_ean13.jpg
or use
http://www.dudek.org/Barcodes/barcode_ean13.jpg?s=0123456789012
to generate you own code, where the number after the s needs to be 12 digits for an EAN-13 barcode (the 13th checksum digit is computed automatically if not provided).


