dragotin / kraft

Kraft helps to handle your daily quotes and invoices in your small business.
http://volle-kraft-voraus.de
GNU General Public License v2.0
58 stars 18 forks source link

openSUSE Leap 15.3: PDF Creation with ReportLab Fails #111

Open dragotin opened 3 years ago

dragotin commented 3 years ago

On a fresh install with openSUSE 15.3 Leap, Kraft can not create PDFs based on Reportlab.

The issue is with python3 (which kraft uses by default) in the reportlib package. This patch fixes it:

--- utils.py    2021-06-01 13:53:48.792141696 +0200
+++ /usr/lib64/python3.6/site-packages/reportlab/lib/utils.py   2021-06-01 13:54:03.636483879 +0200
@@ -870,7 +870,7 @@
                     im = self._image
                     mode = self.mode = im.mode
                     if mode=='RGBA':
-                        if Image.VERSION.startswith('1.1.7'): im.load()
+                        if Image.__version__.startswith('1.1.7'): im.load()
                         self._dataA = ImageReader(im.split()[3])
                         im = im.convert('RGB')
                         self.mode = 'RGB'

Python2 works fine, regardless if the patch was applied or not.