mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement clone_image()
This commit is contained in:
parent
0fbcabad73
commit
5815a5e07d
@ -160,6 +160,11 @@ def crop_image(img, x, y, width, height):
|
|||||||
height = min(height, img.height() - y)
|
height = min(height, img.height() - y)
|
||||||
return img.copy(x, y, width, height)
|
return img.copy(x, y, width, height)
|
||||||
|
|
||||||
|
def clone_image(img):
|
||||||
|
''' Returns a shallow copy of the image. However, the underlying data buffer
|
||||||
|
will be automatically copied-on-write '''
|
||||||
|
return QImage(img)
|
||||||
|
|
||||||
def normalize_format_name(fmt):
|
def normalize_format_name(fmt):
|
||||||
fmt = fmt.lower()
|
fmt = fmt.lower()
|
||||||
if fmt == 'jpg':
|
if fmt == 'jpg':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user