Hello,
Reportlab 3.5.53 with Pillow 8.0.1
I got an error when using:
renderPM.drawToFile(drawing, filename, 'PNG')
The error I get is:
"'Image' object has no attribute 'fromstring'"
Seeing this I tried different versions of the Pillow package and saw that Pillow 7.2 still works.
The error comes due of the fact that the fromstring attribute in Pillow Image is deprecated from 2013 and it was removed in Commit #4798 on the Pillow Git:
Modifying this method from renderPM.py file by removing the optional default parameter:
def toPIL(self):
im = _getImage().new('RGB', size=(self._gs.width, self._gs.height))
getattr(im,'frombytes',getattr(im,'fromstring'))(self._gs.pixBuf)
return im
to:
def toPIL(self):
im = _getImage().new('RGB', size=(self._gs.width, self._gs.height))
getattr(im,'frombytes')(self._gs.pixBuf)
return im
seems to solve the issue.
I hope this report will help.
Best regards,
Marius