From: <rom...@ya...> - 2007-05-28 21:13:21
|
>> My gramps database include a lot of portraits, and i would like to print a family tree using them, but i do not want to had these each times i need to create or modify my genealogy > However, I don't think graphviz (or other GPL graph software) supports pictures in nodes however, so probably a custom report in html or so should be made. If someone know how to get media.path(), this will display a simple HTML Family Tree with portraits !!! from ReportBase._SimpleAccess import SimpleAccess # from ReportBase._SimpleDoc import SimpleDoc # from ReportBase._ReportUtils import * def run(database, document, person): sa = SimpleAccess(database) plist = person.get_media_list() # photo = plist[0] # ReportUtils.insert_image(self.database,self.doc,photo) media = RelLib.MediaObject() for media_ref in plist: path = media.get_path() print "<html><head><style>" print "#skeleton1 {background-color:rgb(153, 255, 153);font-size:1em;margin-left:150px;width:100px;height:70px;text-align:center;margin-top:0px;}" print "#skeleton2 {background-color:rgb(204, 204, 255);font-size:1em;margin-left:300px;width:100px;height:70px;text-align:center;margin-top:100px;}" print "#skeleton3 {background-color:rgb(255, 204, 255);font-size:1em;margin-left:300px;width:100px;height:70px;text-align:center;margin-top:0px}" print "</style></head></body><div id=","'skeleton2'",">",sa.name(sa.father(person)),"<img src=",path," scale=","'100px'","></div>" print "<div id=","'skeleton1'",">",sa.name(person),"<img src=",path," scale=","'100px'","></div>" print "<div id=","'skeleton3'",">",sa.name(sa.mother(person)),"<img src=",path," scale=","'100px'","></div>" print "</html></body>" This is very basic (no headers, don't used parent_in or child_of, no Media paths ... yet), but could be a solution if you need to print a *custom* pedigree with portraits !!! Maybe "mix report" will be a solution, which use both family nodes (person as child, person as parent) with portraits (if exist). SimpleAccess offers an access to Parents, children, spouse. Sure, the code is not very clean but it is a first idea ;) > On heredis, i used to print sometime some family trees, ascending, or descending for people of my family Now, I am able to generate *my* template/model (with children, css, div box) and HTML/css allow us to change background image :-D Also, I don't know if we should use "alt" attribute on <img> markup ? Maybe it is possible to display only portraits and data as alternatif text. PS: works only on very very unstable and unsafe version ... |