+ def size(self):
+ width, height = THUMB_WIDTH, THUMB_HEIGHT
+ if width is None:
+ simg = Image.open(self.logo.path)
+ width = int(float(simg.size[0]) / simg.size[1] * height)
+ elif height is None:
+ simg = Image.open(self.logo.path)
+ height = int(float(simg.size[1]) / simg.size[0] * width)
+ return width, height
+