docs: def wrap(self, availWidth, availHeight):
          " This can be called more than once! Do not overwrite important data like drawWidth "
          availHeight = self.setMaxHeight(availHeight)
          # print "image wrap", id(self), availWidth, availHeight, self.drawWidth, self.drawHeight
          width = min(self.drawWidth, availWidth)
          wfactor = float(width) / self.drawWidth
          height = min(self.drawHeight, availHeight * MAX_IMAGE_RATIO)
          hfactor = float(height) / self.drawHeight
          factor = min(wfactor, hfactor)
          self.dWidth = self.drawWidth * factor
          self.dHeight = self.drawHeight * factor
          # print "imgage result", factor, self.dWidth, self.dHeight
          return self.dWidth, self.dHeight