Commits

Robin Becker  committed 72477b3 Merge

merge forgotten change

  • Participants
  • Parent commits 8abd164, 6aa0842

Comments (0)

Files changed (3)

File src/reportlab/pdfgen/pdfimages.py

 
         #use a flate filter and, optionally, Ascii Base 85 to compress
         raw = myimage.tostring()
-        rowstride = (imgwidth*bpc*bpp+7)/8
+        rowstride = (imgwidth*bpc*bpp+7)>>3
         assert len(raw) == rowstride*imgheight, "Wrong amount of data for image"
         data = zlib.compress(raw)    #this bit is very fast...
         if rl_config.useA85:

File tests/test-cross.tiff

Added
New image

File tests/test_pdfgen_general.py

         gif = os.path.join(testsFolder,'pythonpowered.gif')
         c.drawInlineImage(gif,2*inch, 7*inch)
         c.drawInlineImage(os.path.join(testsFolder,'pythonpowered-gs.gif'),4*inch, 7.5*inch)
+        tif = os.path.join(testsFolder,'test-cross.tiff')   #example of a mode '1' image
+        c.drawInlineImage(tif,1*inch, 1*inch)
+        from reportlab.lib.utils import Image as PilImage
+        if PilImage:
+            c.drawInlineImage(PilImage.open(tif),1.25*inch, 1*inch)
     else:
         c.rect(2*inch, 7*inch, 110, 44)
         c.rect(4*inch, 7*inch, 110, 44)