In the meantime I think there must be a buggy Gimp.Image.serialize().
It seems to be an xml string, but Python's minidom as well as elementtree throw a parse error reading the string.
I help myself with searching the string with string functions, but it feels like computing with an abacus:
It seems to be an xml string, but Python's minidom as well as elementtree throw a parse error reading the string.
I help myself with searching the string with string functions, but it feels like computing with an abacus:
Code:
def get_metadata_value(image, tag):
metadata = image.get_metadata().serialize()
valueStartPos = metadata.find(tag) + len(tag) + 2
valueStart = metadata[valueStartPos:]
value = valueStart[:valueStart.find("<")]
return value