Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Editing metadata in python
#7
(10-05-2021, 12:11 AM)Ofnuts Wrote: 1) No, Gimp doesn't provide an API for this, but updating XML is reasonably easy with the general XML libraries.
2) See post #2
I see. Is there any way to retrieve the metadata in the image, edit the fields I want to change and then add it back to the image? Also how is the XML library referenced in the program? Through a directory? pdb.gimp_image_set_metadata(image,[what goes here?]).

For example this is a way I am trying to add a plug-in to BIMP in order to change the metadata for a batch of images. META.txt being my XML library I set the fields to be updated, this is in the same folder as the .py file. It is not working.
 
#!/usr/bin/python

# -*- coding: utf-8 -*-



from gimpfu import*



def plugin_no_meta(timg, tdrawable):



    pdb.gimp_image_set_metadata( timg, 'META.txt')

     



register(

        "python_no_meta",

        "strip",

        "for imgur or BB",

        "*",

        "*",

        "2016",

        "<Image>/Tools/no metadata...",

        "*",

        [],

        [],

        plugin_no_meta)


main()
Reply


Messages In This Thread
Editing metadata in python - by vndep - 09-24-2019, 01:26 AM
RE: Editing metadata in python - by Ofnuts - 09-24-2019, 08:50 AM
RE: Editing metadata in python - by vndep - 09-24-2019, 09:29 AM
RE: Editing metadata in python - by Ofnuts - 09-24-2019, 11:49 AM
RE: Editing metadata in python - by YeboiXd - 10-04-2021, 10:09 PM
RE: Editing metadata in python - by Ofnuts - 10-05-2021, 12:11 AM
RE: Editing metadata in python - by YeboiXd - 10-05-2021, 03:06 PM

Forum Jump: