Face Tags in Group Photos
miqrogroove opened this issue · 18 comments
One of the major roadblocks preventing me from migrating from FTB to webtrees as my primary tree software is that all of my face tags are stored in FTB. For each person in each photo, I can draw a rectangle on a face and associate it to an individual record. This all gets saved in the gedcom file and exported as well.
Webtrees does a good job of importing the tags connecting the individual to a list of photos, but it ignores the _POSITION line item that lists the four coordinates for the face rectangle.
Is it possible to some day have these face tags displayed in webtrees, and eventually be able to edit them as well?
See also #744
Since some years I sucessfully use this plugin:
https://github.com/UksusoFF/webtrees-photo_note_with_image_map
In addition see this thread: https://www.webtrees.net/index.php/en/forum/2-open-discussion/30219-how-to-mark-individuals-on-group-photo
Searching that repo for the _POSITION tag, nothing is found. So I assume that plugin is in no way compatible with the data already stored in my gedcom file. 😕
Looks like that plugin stores the tags in a new table using some unspecified JSON string. If I had all the free time in the world, I could write a PHP importer to convert individual gedcom tags into database JSON records. Based on what I read in the thread linked above, I would have to re-run the custom importer after every gedcom import in order to re-associate the media objects. Probably days of effort to get all of that working.
The labels/positions can also be stored in the JPEG EXIF data.
I can draw a rectangle on a face and associate it to an individual record
This could create issues when records are merged/renamed. The links would need to be updated.
Understood, but there is no reason for me to figure out how to convert FTB gedcom data to EXIF when webtrees already understands most of the gedcom.
This could create issues when records are merged/renamed. The links would need to be updated.
That would be a concern for the plugin developer. I am only interested in how to import the data to the existing plugin, if that works.
@miqrogroove I can add support for _POSITION. But: https://www.webtrees.net/index.php/en/forum/2-open-discussion/30219-how-to-mark-individuals-on-group-photo?start=260#70306
Yes, I see the gedcom uses 1 OBJE to represent the photo under each individual, and then 2 _PHOTO_RIN to group the objects. Webtrees does import the _PHOTO_RIN, making it just as easy to scan the gedcom file and associate the _POSITION tags with the correct webtrees records.
Like I said, it would be a few days of work and maybe I can take care of it later this year.
@fisharebest Do you have any interest in expanding the wt_link schema to support this? Or is my re-scan of the gedcom file the best way to go?
Do you have any interest in expanding the wt_link schema
wt_link
already contains all links. What change do you need?
BTW - I have never seen a FTB gedcom with the custom tags. Perhaps post an example here?
Based on the discussion about webtrees importing only one tag per photo, it really seems like it's just not saved in the right place. By adding even one more field to wt_link it would be possible to save this data during any gedcom import. This table already stores multiple data points per photo by relating them to individuals.
I can upload a sample later tonight.
Used within an individual record as exported by FTB...
1 OBJE
2 FORM jpg
2 TITL Ferdinand St John Family
2 FILE P1902_482_599.jpg
2 NOTE Photo copied from https://www.findagrave.com/
2 _POSITION 339 87 403 173
2 _PHOTO_RIN MH:P1911
2 _FILESIZE 275866
1 OBJE
2 FORM jpg
2 TITL Curtis Christmas Card
2 FILE P1909_648_486.jpg
2 NOTE Photo copied from https://www.findagrave.com/
2 _DATE 1951
2 _PRIM_CUTOUT Y
2 _POSITION 400 107 488 225
2 _PHOTO_RIN MH:P1918
2 _FILESIZE 153822
1 OBJE
2 FORM jpg
2 TITL Curtis Christmas Card
2 FILE P1911_88_118.jpg
2 _PRIM Y
2 _CUTOUT Y
2 _PHOTO_RIN MH:P1920
@miqrogroove seems like your example will be imported successful. Because it's doesn't contains "duplicated" objects with same filename.
Demo tree with Kennedy family contains:
1 OBJE
2 FORM jpg
2 TITL רגע ×œ×¤× ×™ ×”×”×ª× ×§×©×•×ª
2 FILE tree1_Photos\P3_617_480.jpg
2 _DATE 22 NOV 1963
2 _PLACE Dallas, Texas
2 _PHOTO_RIN MH:P1
2 _FILESIZE 86248
2 OBJE
3 FORM jpg
3 TITL רגע ×œ×¤× ×™ ×”×”×ª× ×§×©×•×ª
3 FILE tree1_Photos\P3_617_480.jpg
3 _DATE 22 NOV 1963
3 _PLACE Dallas, Texas
3 _PHOTO_RIN MH:P1
3 _FILESIZE 86248
1 OBJE
2 FORM jpg
2 TITL רגע ×œ×¤× ×™ ×”×”×ª× ×§×©×•×ª
2 FILE tree1_Photos\P3_617_480.jpg
2 _DATE 22 NOV 1963
2 _PLACE Dallas, Texas
2 _POSITION 350 233 413 299
2 _PHOTO_RIN MH:P1
2 _FILESIZE 86248
1 OBJE
2 FORM jpg
2 TITL רגע ×œ×¤× ×™ ×”×”×ª× ×§×©×•×ª
2 FILE tree1_Photos\P3_617_480.jpg
2 _DATE 22 NOV 1963
2 _PLACE Dallas, Texas
2 _PHOTO_RIN MH:P1
2 _FILESIZE 86248
Full tree here: https://gist.github.com/UksusoFF/629e2054c7e2a3f3f20380c26c3c08ef
I've got a script that is working now to import all face tags from FTB to the webtrees plugin table. It parses the first-level and second-level gedcom sections to find the individual OBJE records that contain a _POSITION. It then truncates the plugin table and converts the _POSITION tags to new database rows. This was necessary because the plugin table is not indexed properly for a INSERT ... ON DUPLICATE KEY query.
@miqrogroove Can you show it? Which table you use? Seems it's not Webtrees issue anymore (third-party plugin dependent).
Yes, it is a hack for a plugin. I'd still like to hear from @fisharebest about expanding wt_link to carry some gedcom data.
I will add a repo for the conversion script. You will be welcome to reuse it.
I am not going to have any time for this until after the 2.0 release.
My initial thoughts are not to modify wt_link
. We use this to find records - which we then analyse.
e.g. we link a source to an individual. We then need to search the individual record to find the facts that reference the source.
Ok I will just use the modules and hacks.