Utilize media metadata Date and Face-Tags in import and references

I am using media a lot and my fotos used in gramps already have metadata (EXIF/XMP/IPTC) for date, location, gps and facetags. When adding such media currenty date and reference to person and defining region (as substitue for facetag) have to be added manually. It would be of great advantage to me and probably others as well, if this information already available would be utilized by gramps. Before I write a feature request I would like to know your opinion on the topic of utilizing media meta-data.

I invision to utilize metadata(jpg,png) as follows:
a) EXIF-DATA: When adding media propose date taken from exif-date
b) When referencing media from a person use face-tag postion as “referenced region”. This avoids to draw manually each face which has been defined alread in the first place. Association between person and facetag-text could be done aquivalent to person-portrait. Facetag of first picture is associated with person.
c) Showing face-tags respective person-name in Image-data or new tab.
• Even more comfort would be to offer all face-tags respective person-name as reference when adding media
• Also helpful, but independend could be
○ to sort media in galleries according exif-date (or date entered.
○ Utilize gps-position (or textual location) to add to places

There is already an acknowledged Feature Request dealing with metadata, actually
Expand ImageMetadata gramplet to support XMP and IPTC metadata tags, but it does not cover ideas presented above. Besides comfort of such features it avoids to duplicate information which is prone for inconsistency which I hate.

What’s your though on that ?

BTW: Gramps is such a powerful tool , therefore I take the opportunity to thank all who have and still do contribute to gramps. And I am waiting eagerly for version 5.2!


I think what you are describing may already have a pull request (that is now out of date) and is discussed here: Suggested Update to PhotoTaggingGramplet to Support XMP Face Regions

I have created a Gist on Github code that updates the Photo Tagging Gramplet. This update displays existing regions in images and allows a user to associate a Gramps Person avoiding the need to redraw the region.

To try this code you need to replace the contents of PhotoTaggingGramplet.py with the contents of this Gist: Gramps - PhotoTaggingGramplet.py - Modified to display person regions embedded in photos · GitHub

I have only tested this on a Windows computer. Please backup your data before using this.

I think you can try a first step at this feature here: Gramps Display XMP Metadata (Including Faces) in Metadata viewer · GitHub Two files must be changed and I am very sure there are better ways to write this code. Both gramps\plugins\gramplet\metadataviewer.py and \gramps\plugins\lib\libmetadata.py need to be replace.

These changes show Named Regions in the photo in the Image Metadata Tag. This is for some reassurance for the user and to help with Photo Tagging.

I have only tested this on windows. Please backup your data before using this.

1 Like

Or, like in geography view, propose places near that position

I tried your enhanced version - it basically works fine! However, I do not understand how this frist step can be used “for some reassurance for the user and to help with Photo Tagging”

It would be great to follow this up and enhance in order to propose references to all named persons. As described above, actually adding persons in the galeria for the person with a portrait (first foto) with this face-tag.

I know it is experimental, I found some problems:
1.) soemtimes faces are show only half height
2.) Sometimes face tags are missing at all - it seems to me this happens in case the face tag is at the edge of a foto (which actually happens with many of my portrait-fotos)

Anyway, thanks for taking the idea to a first step

Thanks for the feedback.

Would you be willing to send me one of these photos so that I can try and reproduce the issues and fix it?

This attempt to reassure that I didn’t delete any metadata in their image. Let me try and explain, this is because of issues I ran into in modifying the 2 gramplets. I have proposed changes to 2 gramplets:

  • Image Metadata (part of Gramps Core (outlined in blue)
  • Photo Tagging Gramplet (an addon) (outlined in red)

I had problems when modifying the Photo Tagging Gramplet that caused extra regions to appear. As a result, the Photo Tagging Gramplet only shows the XMP Regions if the photo has not been associated with a Person by manually drawing regions or added to a person gallery. I decided it would be good for the Image Metadata gramplet to show the region and face so that the user still knows the photo metadata is unaltered.

When you use the Photo Tagging gramplet and associate a person to the XMP Named Region, that portrait will appear in the person’s gallery in the last position.

I tried to modify the search box that appears when you select a person from the PhotoTagging gramplet. I wanted to pass the name in the photo metadata region and search for that value against the names in Gramps. I could not make it work. I don’t understand the Gramps Code well enough. There is a Filter option in the SelectPerson function that I think I need to use but I don’t see what I need to pass.

I hope this helps,

Thanks your follow up my remarks. I attach 3 fotos which have the behaviour described above:

  • Sometimes face tags are missing at all - it seems to me this happens in case the face tag is at the edge of a foto (which actually happens with many of my portrait-fotos
  • sometimes faces are show only half height

Ad face-tag not shown:

Artner, Josef
Wimmer, Anna

Actually portraits are extracted from marriage foto. Portrait foto of Wimmer Anna works well, however Portrait of Artner Josef does not show face tage in Metadata-View. face-tag region is identical wih left border of foto - I could track this behavior down several times to that cause.

Ad haf-sized face-tag
Actually when I start gramps face-tags of the marriage foto are shown correctly. Switching to another foto the effect appaear that only half is shown, also when switching back to fot which worked in the first time.

Hope this helps to track down reasons for this behaviour - and thanks again for following up these topics.

Thanks for the images. I didn’t see any face regions in the metadata and want to make sure nothing was stripped out by the Discourse software. I’m going to send you a Direct Message with my email address. Could you email the photos to me and some of the examples where the region is at the edge of the photo.

I used ExifTool (https://exiftool.org/) to examine the metadata tags in the first file. The result showed there are no face regions embedded in the file.

PS C:\exiftool> exiftool -s -XMP-mwg-rs:all 'c:\exiftool\19081103-000000 Hochzeit Artner Josef und Anna - Pfarre Bruck an der Leitha.jpg'
PS C:\exiftool>

I expected to see a result similar to this example.

PS C:\exiftool> exiftool -s -XMP-mwg-rs:all 'F:\Families\J\Jackson__Edward_Stephen+Henders__Alicia\Jackson__Edward+Henders__Alicia-Maidstone-England-1922.jpg'
RegionName                      : Henders, Alicia Augusta, Jackson, Edward Stephan, Jackson, Henry Benjamin
RegionType                      : Face, Face, Face
RegionAreaX                     : 0.219668, 0.822836, 0.225464
RegionAreaY                     : 0.210395, 0.100658, 0.0743421
RegionAreaW                     : 0.0823029, 0.0915765, 0.0799845
RegionAreaH                     : 0.0655263, 0.0671053, 0.0623684
RegionAreaUnit                  : normalized, normalized, normalized

Let’s work through this offline and we will post a summary of what we learn to the community.


Hi Bruce,

Hopefully this responce works since I could not find any private email-address.

It is quite likely forum software has stripped off something – sorry for confusion caused by this. See attached fotos and in addition the dropbox-link https://www.dropbox.com/sh/hbgqujvxogpkdvq/AAAbcDPq8-8kvz_z3D4cZDjxa?dl=0

Below what my exifgui shows






Artner, Josef.jpg

Wimmer, Anna.jpg

Perfect. The files in the dropbox link contain the regions.

I can reproduce the issue you are seeing with image thumbnails being half-height. I use a custom Theme with Gramps and I don’t have this issue. When I reset Gramps to the default theme, the full image thumbnail does not appear.

I can reproduce the problem with ‘Artner, Josef.jpg’ not showing all image metadata.

I will investigate and let you know what I find.

I have updated my code on github. These changes address the Face Region being past the edge of the image.


In testing for the issue of how the thumbnail is displayed:

I found that the Adwaita and High Contrast themes had problems displaying the full height of the thumbnail. The Raleigh theme seems to display properly. I installed a theme following these instructions: Windows AIO themes - Gramps I am using Gradient-Blue-318 and it seems to work okay.

Maybe someone who knows more about themes will read this and be able to offer some guidance.

Please let me know how the changes work.


Thanks for your updated Photo TaggingGramplet. Face region work fine not only for the example, but for a lot of face-tags which I browsed which previously failed.

Thumbnails are displayed now fully in my environment completely

Thanks again, the feature helps for manually assigning persons!
In the long run I hope someone will take care of automatism as proposed in this topic and other similar ideas posted in mantis

1 Like