Implement clone_image()

This commit is contained in:
Kovid Goyal 2016-05-09 20:26:49 +05:30
parent 0fbcabad73
commit 5815a5e07d

View File

@ -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':