Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian....@packages.debian.org
Usertags: pu

Hello,

I would like to update python-reportlab in jessie as it suffers from a
regression compared to wheezy in the way it handles PNG with transparency
(see #785023 for details). Working code now throws exceptions when it
processes such files.

The patch we used is an upstream patch and the modified code is thus
in use in unstable in the new upstream version that just landed (3.2.0-1).

I checked with the bug reporter that the proposed update does fix
the issue with him.

The debdiff is attached.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/
diff -Nru python-reportlab-3.1.8/debian/changelog 
python-reportlab-3.1.8/debian/changelog
--- python-reportlab-3.1.8/debian/changelog     2014-08-18 16:44:41.000000000 
+0200
+++ python-reportlab-3.1.8/debian/changelog     2015-06-03 21:10:38.000000000 
+0200
@@ -1,3 +1,12 @@
+python-reportlab (3.1.8-3+deb8u1) jessie; urgency=medium
+
+  * Non-maintainer upload.
+  * Add handle-png-with-transparency.patch to avoid failing when reading
+    a PNG with transparency. Closes: #785023
+    This fixes a regression compared to the version in Wheezy.
+
+ -- Raphaël Hertzog <hert...@debian.org>  Wed, 03 Jun 2015 21:04:12 +0200
+
 python-reportlab (3.1.8-3) unstable; urgency=medium
 
   * Build-depend on dh-python.
diff -Nru 
python-reportlab-3.1.8/debian/patches/handle-png-with-transparency.patch 
python-reportlab-3.1.8/debian/patches/handle-png-with-transparency.patch
--- python-reportlab-3.1.8/debian/patches/handle-png-with-transparency.patch    
1970-01-01 01:00:00.000000000 +0100
+++ python-reportlab-3.1.8/debian/patches/handle-png-with-transparency.patch    
2015-06-03 21:08:58.000000000 +0200
@@ -0,0 +1,33 @@
+Description: ImageReader handle png indexed with transparency specially
+Bug-Debian: https://bugs.debian.org/785023
+Origin: upstream, 
https://bitbucket.org/rptlab/reportlab/commits/7df61e325601580bc36db042c6d6a8a776f62eef
+
+diff --git a/src/reportlab/lib/utils.py b/src/reportlab/lib/utils.py
+--- a/src/reportlab/lib/utils.py
++++ b/src/reportlab/lib/utils.py
+@@ -823,7 +823,12 @@
+                         im = im.convert('RGB')
+                         self.mode = 'RGB'
+                     elif mode not in ('L','RGB','CMYK'):
+-                        im = im.convert('RGB')
++                        if im.format=='PNG' and im.mode=='P' and 
'transparency' in im.info:
++                            im = im.convert('RGBA')
++                            self._dataA = ImageReader(im.split()[3])
++                            im = im.convert('RGB')
++                        else:
++                            im = im.convert('RGB')
+                         self.mode = 'RGB'
+                     if hasattr(im, 'tobytes'):  #make pillow and PIL both 
happy, for now
+                         self._data = im.tobytes()
+diff --git a/tests/test_pdfgen_general.py b/tests/test_pdfgen_general.py
+--- a/tests/test_pdfgen_general.py
++++ b/tests/test_pdfgen_general.py
+@@ -715,6 +715,8 @@
+     if haveImages:
+         c.drawImage(gif, 1*inch, 1.2*inch, w, h, mask=myMask)
+         c.drawImage(gif, 3*inch, 1.2*inch, w, h, mask='auto')
++        
c.drawImage(os.path.join(testsFolder,'test-rgba.png'),5*inch,1.2*inch,width=10,height=10,mask='auto')
++        
c.drawImage(os.path.join(testsFolder,'test-indexed.png'),5.5*inch,1.2*inch,width=10,height=10,mask='auto')
+     else:
+         c.rect(1*inch, 1.2*inch, w, h)
+         c.rect(3*inch, 1.2*inch, w, h)
diff -Nru python-reportlab-3.1.8/debian/patches/series 
python-reportlab-3.1.8/debian/patches/series
--- python-reportlab-3.1.8/debian/patches/series        2014-08-11 
23:31:18.000000000 +0200
+++ python-reportlab-3.1.8/debian/patches/series        2015-06-03 
21:10:54.000000000 +0200
@@ -1 +1,2 @@
 gsfonts.diff
+handle-png-with-transparency.patch

Reply via email to