[PythonReports-checkins] PythonReports/PythonReports pdf.py, 1.5, 1.6
Brought to you by:
a1s
|
From: Alexey L. <a-...@us...> - 2011-11-25 10:14:12
|
Update of /cvsroot/pythonreports/PythonReports/PythonReports
In directory vz-cvs-3.sog:/tmp/cvs-serv17797
Modified Files:
pdf.py
Log Message:
priority to embedded images instead of external files
Index: pdf.py
===================================================================
RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/pdf.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pdf.py 11 Oct 2011 14:50:19 -0000 1.5
--- pdf.py 25 Nov 2011 10:14:10 -0000 1.6
***************
*** 2,5 ****
--- 2,6 ----
"""PDF output for PythonReports"""
"""History (most recent first):
+ 25-oct-2011 [luch] priority to embedded images instead of external files
11-oct-2011 [luch] adapted to PIL 1.1.7
07-dec-2006 [als] fix: diagonal lines were offset down by the box height
***************
*** 308,325 ****
"""Draw an image"""
_scale = image.get("scale", True)
! _img = image.get("file")
! if _img:
# it is better to use filename unless we have to cut the image
# (scale will be done by reportlab)
if not _scale:
_img = Image.open(_img)
- else:
- _data = image.get("data")
- if _data:
- _img = self.named_images[_data]
- else:
- # image data must be child element
- _data = StringIO(Data.get_data(image.find("data")))
- _img = Image.open(_data)
(_x, _y, _width, _height) = self.getDimensions(image)
if _scale:
--- 309,324 ----
"""Draw an image"""
_scale = image.get("scale", True)
! # actually, builder embeds all images into the printout
! if image.find("data") is not None:
! _data = StringIO(Data.get_data(image.find("data")))
! _img = Image.open(_data)
! elif image.get("data"):
! _img = self.named_images[image.get("data")]
! else:
! _img = image.get("file")
# it is better to use filename unless we have to cut the image
# (scale will be done by reportlab)
if not _scale:
_img = Image.open(_img)
(_x, _y, _width, _height) = self.getDimensions(image)
if _scale:
|