mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Forgot this in the last commit
This commit is contained in:
parent
9d72a1c3eb
commit
45bbc5452e
@ -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…
x
Reference in New Issue
Block a user