Introduce ImageList.copy()

- imagelist[:] returns a list, not an ImageList
- it returns an instance of ImageList
This commit is contained in:
Laurent Monin
2019-03-21 19:11:18 +01:00
parent caa03f3f0a
commit 76b85a4e1f
2 changed files with 4 additions and 1 deletions

View File

@@ -275,7 +275,7 @@ class Metadata(MutableMapping):
del self[tag]
if other.images:
self.images = other.images[:]
self.images = other.images.copy()
if other.length:
self.length = other.length

View File

@@ -51,6 +51,9 @@ class ImageList(MutableSequence):
def __eq__(self, other):
return self._sorted() == other._sorted()
def copy(self):
return self.__class__(self._images)
def get_front_image(self):
for img in self:
if img.is_front_image():