Jump to content
TNG Community

Photos Are Not Linked after GEDCOM Upload


idogenealogy

Recommended Posts

I think I screwed up when I imported my GEDCOM a few weeks ago. All media ended up in /photos and none are linked. 

Is there ANY way to correct this without having to do over 3,000 files one at a time?

Signed ... Hopeful Nana

Link to comment
Share on other sites

Rob Severijns

Nana,

Was the GEDCOM used created by TNG?

If so did you include the option "Export media links" while creating the GEDCOM?

If so did yo set all the links in Setup >> Configuration >> General Settings>>Import Settings correct?

Did you set the paths in Setup >> Configuration >> General Settings>>Paths and Folders correct?

If you are able to restore a backup from before the import that would be very helpfull otherwise you might have a problem.

Recreating all the links needs to be done manualy if none of the above is possible.

Moving the media from Photo's to other types of media is easy. In Admin>>Media select the appropiate mediafiles and assign another mediatype.

Also see GEDCOM - TNG_Wiki (lythgoes.net) and Import Media Using GEDCOM - TNG_Wiki (lythgoes.net) and Category:Data Protection - TNG_Wiki (lythgoes.net)

Hope this helps.

Rob

Link to comment
Share on other sites

On 11/12/2022 at 3:50 PM, idogenealogy said:

I think I screwed up when I imported my GEDCOM a few weeks ago. All media ended up in /photos and none are linked. 

Is there ANY way to correct this without having to do over 3,000 files one at a time?

Did the GEDCOM file include media links?

Look through the GEDCOM file for lines that include something like:

2 FILE ~/Documents/Documents/Genealogy/Roger/ReunionPictures/photos/people/RogerOval.JPG

where 2 could be a different number than 2, then says FILE and then has a path to a media item

Roger

 

 

Link to comment
Share on other sites

Robin Richmond

First - what is the source of your Gedcom? Or (probably) equivalently, what desktop software are you using?  Aside from the Gedcom-specific wiki articles that Roger mentioned, you might want to look at the Gedcom Converter mod

With respect to media files defined in a Gedcom file, Family Tree Maker (FTM) is notable (negatively) in that it always and only puts all media files in a single folder. You'll see below why that matters,

On 11/12/2022 at 3:50 PM, idogenealogy said:

All media ended up in /photos

 

Do you mean that all of your files are in the your photos folder, or that the mediatype of your media records is "Photos"?

Significantly, the Gedcom import process is completely oblivious to where your files are stored within your TNG folder structure. But the location of files with respect to the program that generated the Gedcom file is likely to be stored in the Gedcom folder where it can have an effect on the Gedcom Import process. 

Still, it is not always possible for the Gedcom import process to determine what a file's Mediatype should be. I'll describe my understanding of how it works below.

Almost all TNG programs, but certain the Gedcom Import, execute these statements in tngfiletypes.pop, thus building a mapping between filetypes (often just derived from filename
extensions)  and 5 of TNG's build-in Mediatypes.

$imagetypes = array( "JPG", "GIF", "PNG", "JPEG", "GIFF", "JFIF" );
$videotypes = array( "AVI", "MPG", "MOV", "WMV", "3GP", "M4V", "MP4", "ASF", "FLV" );
$historytypes = array( "DOC", "DOCX", "TXT", "PHP", "HTM", "HTML", "WPD" );
$documenttypes = array( "PDF" );
$recordingtypes = array( "MP3", "WMA", "WAV", "AU", "M4A" );

(At least practically speaking) the Gedcom Import process looks at the entire OBJE record before trying to determine the Mediatype. It does so because it needs both the FORM tag and the FILE tag.

  • FILE tag values are the full path to the file from the perspective of the application that generated the Gedcom. The Gedcom import process tries to match the Local paths (from Admin>>Setup>>Import Settings) with the beginning of the Gecom FILE tag value. If it does find a match, it strips that Local path from the Gedcom path, producing the "filepath" that is used by the Gedcom Import process.
  • FORM tag are not alway present, but they are, they can be useful. However their values might just be the equivalent of a filename extension (e.g. JPG, PDF, etc) or might be something like "Document", "Image", "Photo", etc.

Once it has read the entire OBJE recordm, it will determine the Mediatype according to the first of the following "rules" that succeed. (Frankly, I'm not absolutely sure that I have them in the correct order, but for this message, that shouldn't matter.)

  1. It takes the filepath value that it determined above and does a SQL query that looks for that filepath value in the path field of the Media table. If it finds a matching Media record, it keeps the existing Mediatype.
  2. The Mediatype of the Local path that matched the Gedcom filepath (as described above) will be assigned to the media record IFF that path is unique among the Local filepaths. (FWIW, this rule will never be used with Family Tree Maker Gedcom files beause all of its filepaths are identical.)
  3. If the FORM value matches a Mediatype, it will chose that Mediatype.
  4. At this point, assuming that the FORM value is equivalent to a filename extension, I'm not sure whether FORM value or the filename extension takes precedence, but either way, it determines the Mediatype by looking for that value in the arrays defined by the PHP code above.
  5. If all else fails, I think that it uses "Photos"

It is very important to realize that, if the Gedcom import process falls to rule 4, or if rule 3 is insufficiently precise, it will assign all JPG files to "Photos", all PDF files to Documents, and so on. That's usually a problemn because, of course, many documents and histories are represented by a scanned image in a JPG file, many PDF files are histories, and so on. If this happens to you, then you must either

  • Use the Admin Media Editor to change each Media record that has the wrong Mediatype, or
  • Try to use the Admin Media Predefined Search mod, which lets you define rules based on terms within the filenames. For instance, you may want all files whoswe filename contains the words "Census" or "Divorce" to be Documents.   If the Admin Media Predefined Search wiki article does not tell you everything you need to know about it, we can address in additional messages.
On 11/12/2022 at 3:50 PM, idogenealogy said:

none are linked.

This is a separate consideration, where the following points may be significant

A typical Gedcom import essentially replaces an entire tree. It starts by deleting all of the tree's People, Families, Notes, Sources, Repositories, Addresses, and Associations  and some Places, but does not detele any Media records.  Exactly what it does with Citations and Mediatypes changes with some Gedcom upgrades, but you can generally figure that it will delete or at least replace almost all Citations and Medialinks.

On the Gedcom Import kickoff form, be sure to check the "Import media links" checkbox

If you have created Medialinks through TNG data entry,  you'll (probably) need to use the Gedcom Import Purge mod preserve them. (Note that Medialinks to Places cannot be defined in a Gedcom file. I depend on Gedcom Import Purge to preserve Medialinks to Places, but it's possible that the currect version of TNG preserves them natively.)

As Roger suggested, it is possible that your PC genealogy program ignores medialinks unless you explicitly tell it to include them.

- Robin

Link to comment
Share on other sites

  • 1 month later...
idogenealogy

Got overrun by Thanksgiving, then Christmas. Haven't worked on this in at least 5 weeks. 
Thanks for the help. Please don't close this thread. Need to absorb the above and try the suggestions.

Lynda (Nana)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...