mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-22 05:04:46 +03:00
commit
05ebc6cbd9
|
@ -539,6 +539,7 @@ class Image:
|
|||
self.readonly = 0
|
||||
self.pyaccess = None
|
||||
self._exif = None
|
||||
self._xmp = None
|
||||
|
||||
@property
|
||||
def width(self):
|
||||
|
@ -1320,22 +1321,21 @@ class Image:
|
|||
|
||||
def getxmp(self):
|
||||
|
||||
xmp = {}
|
||||
|
||||
for segment, content in self.applist:
|
||||
if segment == 'APP1':
|
||||
marker, xmp_tags = content.rsplit(b'\x00', 1)
|
||||
#print(marker)
|
||||
print(xmp_tags)
|
||||
if marker == b'http://ns.adobe.com/xap/1.0/':
|
||||
print(xmp_tags.decode('latin-1'))
|
||||
root = xml.etree.ElementTree.fromstring(xmp_tags)
|
||||
print(root)
|
||||
for element in root.findall('.//'):
|
||||
print(element.tag.split('}')[1])
|
||||
print(element.attrib)
|
||||
xmp_atribs = []
|
||||
for child, value in element.attrib.items():
|
||||
print(child.split('}')[1] + ": " + value)
|
||||
xmp_atribs.append({child.split('}')[1]: value})
|
||||
xmp.update({element.tag.split('}')[1]: atrib})
|
||||
|
||||
return root
|
||||
|
||||
return xmp
|
||||
|
||||
def getim(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user