def wrap(self, availWidth, availHeight): #print 123, self.drawWidth, self.drawHeight, self.pisaZoom #self.drawWidth *= self.pisaZoom #self.drawHeight *= self.pisaZoom # print 456, self.drawWidth, self.drawHeight width = min(self.drawWidth, availWidth) # print 999, width, self.drawWidth, availWidth factor = float(width) / self.drawWidth # print 123, factor self.drawHeight = self.drawHeight * factor self.drawWidth = width return Image.wrap(self, availWidth, availHeight)
def wrap(self,availWidth,availHeight): h, w = Image.wrap(self,availHeight,availWidth) return w, h