Merge pull request #3 from UrielMaD/xmp_feature

xmp feature
This commit is contained in:
Uriel Martinez 2020-12-25 21:34:28 -06:00 committed by GitHub
commit 38fb073550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1319,7 +1319,24 @@ class Image:
return self._exif return self._exif
def getxmp(self): def getxmp(self):
return "Hello World"
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 = ET.fromstring(xmp_tags)
print(root)
for element in root.findall('.//'):
print(element.tag.split('}')[1])
print(element.attrib)
for child, value in element.attrib.items():
print(child.split('}')[1] + ": " + value)
return root
def getim(self): def getim(self):
""" """