コード例 #1
0
 def resize_image(self, raw, base, max_width, max_height):
     resized, img = resize_to_fit(raw, max_width, max_height)
     if resized:
         base, ext = os.path.splitext(base)
         base = base + '-%dx%d%s' % (max_width, max_height, ext)
         raw = image_to_data(img, fmt=ext[1:])
     return raw, base, resized
コード例 #2
0
ファイル: images.py プロジェクト: j-howell/calibre
 def resize_image(self, raw, base, max_width, max_height):
     resized, img = resize_to_fit(raw, max_width, max_height)
     if resized:
         base, ext = os.path.splitext(base)
         base = base + '-%dx%d%s' % (max_width, max_height, ext)
         raw = image_to_data(img, fmt=ext[1:])
     return raw, base, resized