![]() |
|
Gimp 3.0 get Metadata with Python - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: Gimp 3.0 get Metadata with Python (/Thread-Gimp-3-0-get-Metadata-with-Python) |
Gimp 3.0 get Metadata with Python - Volker - 11-08-2025 How do I retrieve jpg metadata from a Python plug-in in Gimp 3.0? I open a jpg photo and need some metadata. With Gimp 2 and Python 2 I used the plug-in "gimp_image_get_metadata". My code was (abridged): Code: import xml.etree.ElementTree as ETCode: metadata = image.get_metadata()Is there a different approach? My system: Mac mini (Apple M2), macOS Tahoe (26.0.1) My Gimp: 3.0.6 My Python: 3.10 RE: Gimp 3.0 get Metadata with Python - Volker - 11-09-2025 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: Code: def get_metadata_value(image, tag):RE: Gimp 3.0 get Metadata with Python - CmykStudent - 11-09-2025 Volker: Hi! This appears to be a bug that will be fixed for the next release. More info here: https://gitlab.gnome.org/GNOME/gimp/-/issues/15179 |