mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 21:33:05 +02:00
Implement clone_image()
This commit is contained in:
parent
0fbcabad73
commit
5815a5e07d
1 changed files with 5 additions and 0 deletions
|
|
@ -160,6 +160,11 @@ def crop_image(img, x, y, width, height):
|
|||
height = min(height, img.height() - y)
|
||||
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):
|
||||
fmt = fmt.lower()
|
||||
if fmt == 'jpg':
|
||||
|
|
|
|||
Loading…
Reference in a new issue