0001055: Pictures of the gallery are not used in the detailed ancestor's report when output format is PDF
svn: r8623
This commit is contained in:
parent
a226819f70
commit
605d6a20ea
@ -1,3 +1,7 @@
|
||||
2007-06-22 Brian Matherly <brian@gramps-project.org>
|
||||
* src/docgen/Pdfdoc.py: 0001055: Pictures of the gallery are not used in the
|
||||
detailed ancestor's report when output format is PDF
|
||||
|
||||
2007-06-21 Alex Roitman <shura@gramps-project.org>
|
||||
* src/Editors/_EditFamily.py (EditFamily.__do_save): Disconnect
|
||||
all signal handlers before committing data.
|
||||
|
@ -35,6 +35,7 @@ from gettext import gettext as _
|
||||
import BaseDoc
|
||||
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
|
||||
import Errors
|
||||
from QuestionDialog import ErrorDialog
|
||||
import ImgManip
|
||||
import Mime
|
||||
|
||||
@ -99,6 +100,9 @@ if version_tuple < (2,0):
|
||||
else:
|
||||
enc = pass_through
|
||||
|
||||
# Only announce PIL warning once per use of Gramps
|
||||
_pil_warn = True
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# GrampsDocTemplate
|
||||
@ -336,14 +340,11 @@ class PdfDoc(BaseDoc.BaseDoc):
|
||||
|
||||
def add_media_object(self,name,pos,x_cm,y_cm):
|
||||
try:
|
||||
img = ImgManip.ImgManip(nname)
|
||||
img = ImgManip.ImgManip(name)
|
||||
except:
|
||||
return
|
||||
|
||||
x,y = img.size()
|
||||
|
||||
if (x,y) == (0,0):
|
||||
return
|
||||
|
||||
if (x,y) == (0,0):
|
||||
return
|
||||
@ -357,7 +358,24 @@ class PdfDoc(BaseDoc.BaseDoc):
|
||||
act_height = y_cm
|
||||
act_width = x_cm/ratio
|
||||
|
||||
im = Image(str(name),act_width*cm,act_height*cm)
|
||||
try:
|
||||
# Reportlab uses PIL to layout images. Make sure it is installed.
|
||||
import PIL
|
||||
except:
|
||||
global _pil_warn
|
||||
if _pil_warn:
|
||||
ErrorDialog(
|
||||
_("You do not have the Python Imaging Library installed "
|
||||
"Images will not be added to this report"))
|
||||
_pil_warn = False
|
||||
return
|
||||
|
||||
try:
|
||||
im = Image(str(name),act_width*cm,act_height*cm)
|
||||
except:
|
||||
ErrorDialog( _("Reportlab is unable to add this image: %s") % name )
|
||||
return
|
||||
|
||||
if pos in ['left','right','center']:
|
||||
im.hAlign = pos.upper()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user