0001055: Pictures of the gallery are not used in the detailed ancestor's report when output format is PDF
svn: r8625
This commit is contained in:
parent
cc26961713
commit
336cd588e6
@ -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-20 Don Allingham <don@gramps-project.org>
|
2007-06-20 Don Allingham <don@gramps-project.org>
|
||||||
* src/DbManager.py: Catch the icons properly
|
* src/DbManager.py: Catch the icons properly
|
||||||
* src/GrampsDb/_GrampsDBDir.py: catch error on lock file deletion
|
* src/GrampsDb/_GrampsDBDir.py: catch error on lock file deletion
|
||||||
|
@ -36,6 +36,7 @@ from gettext import gettext as _
|
|||||||
import BaseDoc
|
import BaseDoc
|
||||||
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
|
from PluginUtils import register_text_doc, register_draw_doc, register_book_doc
|
||||||
import Errors
|
import Errors
|
||||||
|
from QuestionDialog import ErrorDialog
|
||||||
import ImgManip
|
import ImgManip
|
||||||
import Mime
|
import Mime
|
||||||
|
|
||||||
@ -100,6 +101,9 @@ if version_tuple < (2,0):
|
|||||||
else:
|
else:
|
||||||
enc = pass_through
|
enc = pass_through
|
||||||
|
|
||||||
|
# Only announce PIL warning once per use of Gramps
|
||||||
|
_pil_warn = True
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GrampsDocTemplate
|
# GrampsDocTemplate
|
||||||
@ -342,15 +346,12 @@ class PdfDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc,BaseDoc.DrawDoc):
|
|||||||
|
|
||||||
def add_media_object(self,name,pos,x_cm,y_cm):
|
def add_media_object(self,name,pos,x_cm,y_cm):
|
||||||
try:
|
try:
|
||||||
img = ImgManip.ImgManip(nname)
|
img = ImgManip.ImgManip(name)
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
x,y = img.size()
|
x,y = img.size()
|
||||||
|
|
||||||
if (x,y) == (0,0):
|
|
||||||
return
|
|
||||||
|
|
||||||
if (x,y) == (0,0):
|
if (x,y) == (0,0):
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -363,7 +364,24 @@ class PdfDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc,BaseDoc.DrawDoc):
|
|||||||
act_height = y_cm
|
act_height = y_cm
|
||||||
act_width = x_cm/ratio
|
act_width = x_cm/ratio
|
||||||
|
|
||||||
|
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)
|
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']:
|
if pos in ['left','right','center']:
|
||||||
im.hAlign = pos.upper()
|
im.hAlign = pos.upper()
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user