mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-22 13:14:45 +03:00
commit
5adffb5e71
|
@ -1320,23 +1320,22 @@ class Image:
|
||||||
|
|
||||||
def getxmp(self):
|
def getxmp(self):
|
||||||
|
|
||||||
for segment, content in self.applist:
|
for segment, content in self.applist:
|
||||||
if segment == 'APP1':
|
if segment == 'APP1':
|
||||||
marker, xmp_tags = content.rsplit(b'\x00', 1)
|
marker, xmp_tags = content.rsplit(b'\x00', 1)
|
||||||
#print(marker)
|
#print(marker)
|
||||||
print(xmp_tags)
|
print(xmp_tags)
|
||||||
if marker == b'http://ns.adobe.com/xap/1.0/':
|
if marker == b'http://ns.adobe.com/xap/1.0/':
|
||||||
print(xmp_tags.decode('latin-1'))
|
print(xmp_tags.decode('latin-1'))
|
||||||
root = ET.fromstring(xmp_tags)
|
root = ET.fromstring(xmp_tags)
|
||||||
print(root)
|
print(root)
|
||||||
for element in root.findall('.//'):
|
for element in root.findall('.//'):
|
||||||
print(element.tag.split('}')[1])
|
print(element.tag.split('}')[1])
|
||||||
print(element.attrib)
|
print(element.attrib)
|
||||||
for child, value in element.attrib.items():
|
for child, value in element.attrib.items():
|
||||||
print(child.split('}')[1] + ": " + value)
|
print(child.split('}')[1] + ": " + value)
|
||||||
|
|
||||||
|
return root
|
||||||
return root
|
|
||||||
|
|
||||||
def getim(self):
|
def getim(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user