Can I use tags to allocate primary photo?

I’ve imported a .ged with photos but the allocation of primary photos is lost.
How to proceed?

GED files don’t have photos. At best they maintain whatever link the program had that exported the GEDCOM file. Your only real option is to check and see if the data is coming from a program that RM can directly import from and do a transfer that way. If not, you next option is to manually re-attach all photos.

1 Like

Thank you for your reaction. Problem solved by chatGPT

I used SQLITE to edit my file.

UPDATE MediaLinkTable
SET IsPrimary = 1
WHERE IsPrimary = 0;

No, RM does not import directly from Aldfaer.

I am not familiar with Aldfaer or how it links images. There maybe some SQLite options to do this if you are familiar with SQL.

1 Like

Done. SQLite worked fine.

It’s probably a non-issue for your use case, but when there is more then one media file associated with a person or with any other item in RM such as a fact, only one of them should be marked as primary. When you mark files as Primary or not Primary with the RM user interface, then RM enforces this convention. In other words, if you turn on Primary for one media file, then RM turns off Primary for any other files associated with the same item. When you mark files as Primary or not Primary with SQLite, this convention is not enforced unless your SQLite script enforces it.

As I mentioned, in your use case it’s likely there is only one Primary photo per person or other item. And even if there is more than one, I doubt that any actual harm will come to your RM database. Nevertheless, you might want to run the following script to see if you have any cases where more than one media file is marked as primary for the same person or other item in your RM database. This will not correct any problems. It will just find them.

SELECT COUNT(*) AS ccc, ML.LinkID, ML.MediaID, ML.OwnerType, ML.OwnerID, ML.IsPrimary
FROM MediaLinkTable AS ML
WHERE ML.IsPrimary = 1
GROUP BY ML.MediaID, ML.OwnerType, ML.OwnerID, ML.IsPrimary
HAVING ccc != 1

I suspect that if you run this query, there will be no hits. There would only be hits if you linked more then one media file to the same person or other item and then ran your chatGPT authored script.

I didn’t restrict my little test script just to media attached to the Person. The script will identify multiple Primary media files to any item in your database. Those with OwnerType=0 are associated with a person and those with OwnerType = some other value are associated with something else such as a fact or a citation.

1 Like

Thank you. I joined only one picture per person, so everything went fine.