mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-25 11:33:42 +03:00
XMP feature added
This commit is contained in:
parent
50e88764e8
commit
9947655b93
|
@ -539,6 +539,7 @@ class Image:
|
||||||
self.readonly = 0
|
self.readonly = 0
|
||||||
self.pyaccess = None
|
self.pyaccess = None
|
||||||
self._exif = None
|
self._exif = None
|
||||||
|
self._xmp = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def width(self):
|
def width(self):
|
||||||
|
@ -1323,8 +1324,8 @@ class Image:
|
||||||
Returns an object containing the xmp tags for a given image.
|
Returns an object containing the xmp tags for a given image.
|
||||||
:returns: XMP tags in an object.
|
:returns: XMP tags in an object.
|
||||||
"""
|
"""
|
||||||
|
if self._xmp is None:
|
||||||
xmp = {}
|
self._xmp = {}
|
||||||
|
|
||||||
for segment, content in self.applist:
|
for segment, content in self.applist:
|
||||||
if segment == "APP1":
|
if segment == "APP1":
|
||||||
|
@ -1335,9 +1336,9 @@ class Image:
|
||||||
xmp_atribs = []
|
xmp_atribs = []
|
||||||
for child, value in element.attrib.items():
|
for child, value in element.attrib.items():
|
||||||
xmp_atribs.append({child.split("}")[1]: value})
|
xmp_atribs.append({child.split("}")[1]: value})
|
||||||
xmp.update({element.tag.split("}")[1]: xmp_atribs})
|
self._xmp.update({element.tag.split("}")[1]: xmp_atribs})
|
||||||
|
|
||||||
return xmp
|
return self._xmp
|
||||||
|
|
||||||
def getim(self):
|
def getim(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user