Indexed GEDCOM Method

Instructions for Adding Photographs


********* PRINT THIS FILE. YOU'LL WANT TO HAVE IT HANDY *********

This file summarizes the procedure for adding photographs to your IGM based genealogical database. Photographs which you add will probably be in the form of either GIF or JPG files.

GEDCOM Modifications for Including Pictures

The Indexed GEDCOM Method (IGM) links picture files like GIFs and JPGs into a GEDCOM file by defining a new GEDCOM tag. A tag is a four-letter identifier used within a GEDCOM file to denote an instance of a particular type of information. Common tags in a GEDCOM file are

There are numerous other tags. Tags can be nested to present linked information.

An important characteristic of GEDCOM tags is that programs which read and interpret them do not have to understand all of them. If a program comes across a GEDCOM tag it doesn't understand, it is supposed to ignore it. Therefore, we can invent a tag of our own to denote the links to picture files, and it should not interfere with any other interpretation of the GEDCOM file.

We will define a tag called _PHOT which will introduce the links to graphics files. To illustrate how this tag is used, a small section of a GEDCOM file, with the new tag included, is reproduced below.

     0 @I011@ INDI
     1 NAME Ellen Louise /Gordon/
     1 _PHOT EllenLouiseGordon1.jpg
     1 _PHOT EllenLouiseGordon2.jpg
     1 SEX F
     1 BIRT
     2 DATE 1 SEP 1841
     2 PLAC Rushford, NY
     1 DEAT
     2 DATE 14 NOV 1919
     2 PLAC Madison County, MT
     1 FAMS @F006@
     1 FAMC @F011@

The number which is the first item in each line here is an indicator of the level of nesting of the tags. You can see that we have added the new tags right after the individual's name tag. Several things should be noted here.

  1. In general, GEDCOM tags should not be required to be any particular place within the information about the person whom they reference. However, since this GEDCOM is being modified only for the purpose of being displayed by the IGM system, we will require that the _PHOT tag come immediately after the NAME tag. This is for the convenience of the Perl program which must interpret it.
  2. Note that this individual has two pictures. In general, any number of pictures may be specified; they will be arrayed horizontally across the web page below the main title. In pedigree and descendancy charts which include pictures, the first specified picture will be the one used, so the "preferred" picture should be specified first.
  3. Just as one individual can have more than one picture, one picture can be linked to more than one individual. For instance, if you have a group picture of children, you might want to show it on both the father's and the mother's pages.

Automating the Procedure

Although the above convention can easily be used to link pictures into your database, it would still be pretty laborious in practice if you had to manually edit the tags into the GEDCOM each time you generated a revised GEDCOM file. Therefore the IGM set of files contains a PC program called addphotos.exe, which allows you to automate the procedure.

In order to use the addphotos program, you need to compile and maintain an index file which connects the individuals in the GEDCOM file to the pictures which relate to them. The name of this file should have the same root as your GEDCOM file, and should have the three-letter extension .pdx. For instance, if the name of your GEDCOM is Macdonald.ged, the index file should be named Macdonald.pdx. This file is just an ASCII text file, and can easily be created with a text editor such as the DOS Editor or Notepad. Below is an example of a section of such a file.

     I010 WilliamAsburyFletcher.jpg
     I011 EllenLouiseGordon1.jpg
     I011 EllenLouiseGordon2.jpg
     I012 FordyceFosterGordon.jpg
     I034 SarahAnnSmith.jpg

Each line of the file consists of two entries. The first is the individual tag of the person of interest. This goes with the INDI tag in the GEDCOM file, and serves as a unique identifier of this person throughout the file. The tag here should include the "I", but not the "@"s which surround it in the GEDCOM file. The second item on the line is the name of the file. Note that, as above, two pictures are included for Ellen Louise Gordon.

Once you have created the index file, you can create the modified GEDCOM file containing the _PHOT tags by giving the command

     addphotos Macdonald

at the DOS prompt. Note that since this is being done as part of the final preparation for upload of the GEDCOM file, and since it does make changes to the GEDCOM file itself, it is strongly suggested that you make a copy of the GEDCOM in a special pre-upload directory and perform these steps on that copy.

This method might seem unnecessarily cumbersome, especially if you are not used to editing text files, but it really should be rather straightforward. Unless you have a very large number of pictures, the size of the index will be fairly small. In addition, when a GEDCOM is updated and regenerated, the INDI tags do not change in general, so you will not have to change the index when the GEDCOM is updated, only when you add new pictures.

Thumbnail Photos

The pictures in your genealogical database may have a variety of sizes and shapes. The igmget.cgi script which generates the data page for an individual is set up to show any pictures tied to that individual at the top of the generated HTML page. In order to keep the page format consistent, igmget.cgi shows all pictures, regardless of their true size, with a height of 200 pixels and a width such that the picture has the correct aspect ratio. The full-size picture may be seen by clicking on the (possibly) reduced picture at the top of the individual's data page.

This situation may lead to wasted download time, particularly for large pictures, due to the fact that your browser must download the full picture, even though it is only going to display a reduced, lower-resolution version of it. This inefficiency is particularly acute when a large number of pictures is being downloaded, as when displaying a pedigree or descendant tree. Especially for large pictures, it makes sense to maintain two versions of the picture: the full-size one, and a smaller, or thumbnail, version which may be downloaded quickly for the smaller display.

The IGM program suite is set up to accommodate this situation. In the above example, suppose that the picture EllenLouiseGordon2.jpg is a very large file. Using any of a variety of graphics programs (e.g. Paint Shop Pro from JASC Software, you can create a smaller, lower-resolution version of the picture. Ideally, this picture will have a height of 200 pixels and a width such as to match the original picture's aspect ratio, but the thumbnail can actually be made smaller to reduce download time. The thumbnail picture should be given the same name as the original picture, except with the suffix "_thumb" after the main part of the name. For the above example, the name of the thumbnail would be EllenLouiseGordon2_thumb.jpg. The IGM programs which display reduced-size versions of pictures, such as igmget.cgi, igmpedtree.cgi, and igmdesctree.cgi, will always preferentially display a picture with the suffix "_thumb", if it exists. But if the user clicks on the thumbnail image, the full size picture will be downloaded and displayed on its own page. Note that the photo index (.pdx) file does not need to reference the thumbnail file; it still just references the file EllenLouiseGordon2.jpg. Thus, thumbnails can be uploaded and used without the necessity of regenerating the modified GEDCOM file. Both the full-size picture and the thumbnail picture must be located in the main photos directory.

Adding Captions to Pictures

It is sometimes useful to add captions to pictures displayed by the IGM programs. For instance, the source or other information about the picture may be noted, or, if a picture shows multiple people (e.g. the children of a family), a caption can be used to identify the individuals shown.

The addphotos program mentioned above supports addition of captions which are displayed when a photo is displayed as a full frame. In order to implement this, a file called Captions.txt should be created in the same directory where the GEDCOM file and the .pdx file reside. This file specifies the photos which captions exist, and the captions linked to them. Below is an example of a section of such a file.

CAPT FourGen.jpg
Note:  This picture shows four generations of one family!

CAPT DDuckFamily.jpg
Donald Duck Family
Top:  Daisy Duck      Donald Duck     Scrooge McDuck
Bottom:  Huey     Dewey     Louie

Each line of the file begins with the keyword CAPT followed by the name of a picture file. Following that are one or more lines giving the text of the caption to be shown below the figure, followed by a blank line. When displayed, each line of the caption will be centered below the picture. Spaces in the lines of the caption will be preserved so that, for instance, the names of persons in a picture can be placed below them. Note that, since the CAPT citation refers only to the name of the picture file, a picture tied to multiple individuals will display correctly on each of those individuals' pages. For examples of captioned pictures, see here and here.

Hints for Pictures

A few hints are in order for dealing with pictures. First, pictures can take up a lot of space. They are generally not worth just a thousand words, but a few tens or hundreds of thousands of words, of computer memory. It is easy to fill up even tens of megabytes of server space with just pictures. But a few guidlines can help here.

Doug Macdonald <DAMacdonald@juno.com>