mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-20 01:13:51 +01:00
Forgot this in the last commit
This commit is contained in:
parent
9d72a1c3eb
commit
45bbc5452e
1 changed files with 2 additions and 0 deletions
|
|
@ -79,6 +79,8 @@ def image_to_data(img, compression_quality=95, fmt='JPEG'):
|
|||
raise ValueError('Failed to export image as ' + fmt)
|
||||
return ba.data()
|
||||
|
||||
def resize_image(img, width, height):
|
||||
return img.scaled(int(width), int(height), Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
|
||||
|
||||
def scale_image(data, width=60, height=80, compression_quality=70, as_png=False, preserve_aspect_ratio=True):
|
||||
''' Scale an image, returning it as either JPEG or PNG data (bytestring).
|
||||
|
|
|
|||
Loading…
Reference in a new issue