def WriteFigure(self, caption, filename, scale): thefile = os.path.normpath(filename) from ROOT import TImage im = TImage.Open(thefile + ".png", TImage.kPng) if not im.IsValid(): logging.warning(" the picture " + thefile + ".png does not exist.") self.page.append("<CENTER>") self.page.append("<FIGURE>") self.page.append("<IMG ALIGN=\"center\" SRC=\""+os.path.basename(filename)+\ ".png\" WIDTH=\""+str(scale*im.GetWidth())+"\" HEIGHT=\""+str(scale*im.GetHeight())+"\">\n<FIGCAPTION>") self.WriteText(caption) self.page.append("</FIGCAPTION>\n</FIGURE>\n") self.page.append("</CENTER>\n")
def WriteFigure(self,caption,filename): thefile = os.path.normpath(filename) from ROOT import TImage im = TImage.Open(thefile+".png",TImage.kPng) if not im.IsValid(): logging.warning(" the picture "+ thefile+".png does not exist.") if im.GetWidth()!=0: scale = 620./im.GetWidth() else: scale = 1. self.page.append(" <center>\n") self.page.append(' <img src=\'' + os.path.basename(filename) + \ '.png\' ' + 'height=\''+ str(scale*im.GetHeight())+'\' alt =\'\' />\n') self.page.append(" </center><br /> <br />\n")