PixTag Description File
The contents of the file is simple text, so it can be edited with a plain text editor like notepad or emacs, and processed with easy to write tools. A simple file is show below.
<pixtag> <photo file="20030801_163001.jpg" > <desc>Uncle Harvey with a Monkey. The big party at Uncle Harvey's House</desc> </photo> </pixtag>
The entire file is enclosed by the <pixtag></pixtag> pair of tags. Each individual photo is described by a <photo></photo> block. Within the opening tag, the file="filename" tells us the name of the image file. Within the photo block, a <desc></desc> pair of tags enclose the text describing the photo. That's all you need for a file.
Since I am using the unique file names described below, I don't plan on putting any directory information in the file= tag. I plan on just having the tools search through many directories for that unique file name. That way, it doesn't matter if I move pictures around, group them into directories based on some sort of subject matter, etc. There is some flexibility in how the master file is handled. In most cases, I expect that there will be one file with all of the pictures a person has. However, I can also see people partitioning the files by year, and perhaps super-aggressive users might even loading them into a mysql database.
I suggest the pixtag file extension for the master files. So for a single file it might look like:
loffredo.pixtag
For multiple years it might look like
196x_loffredo.pixtag 197x_loffredo.pixtag 1980_loffredo.pixtag 1981_loffredo.pixtag
Since we might have many photos taken during a particular event, it would be nice to have some way to just describe that event once and then reference it, rather than repeating the same text in every one of the photos. The <event></event> tag lets you do this if you want to:
<pixtag> <event id="20030801_party" > <desc>The big party at Uncle Harvey's House</desc> </event> <photo file="20030801_163001.jpg" > <desc>Uncle Harvey with a Monkey</desc> <event ref="20030801_party" /> </photo> </pixtag>
When you declare the <event>, the opening tag needs an id="eventname" that we will use to refer to it later. I suggest using the date, and a short word or two separated by underscores. Within the event block, we use the <desc></desc> tags, the same way we do in our photo blocks, for text describing the event.
Finally, we indicate that a photo was taken at a particular event by putting in a reference tag of the form:
<event ref="eventname" />
Note that the closing /> is a little different than we have seen before, but is important. Photos can reference as many events as you would like. Just add more <event ref="" /> tags to the photo block.
Technically, all of this is well-formed XML, but I don't want to make a big deal about it, because a) the only people who care are software developers, and b) the first thing they would want to do is make the format more complex with various XML arcana. The only place where you might notice is that ampersands "&" are special in XML, so if you have one in a description, you need to write it as "&" or else tools will complain "not well-formed (invalid token)" when they see it.
Going forward, I will define some more optional tags when it comes time to store the EXIF camera settings from pictures, and of course, I fully suspect that some enterprising types will add their own tags for their personal applications. That's fine, but for the base format, I refer back to the design goals -- keep it simple!
Copyright © 2020 David Loffredo, licensed under CC BY-SA 4.0.