Image-ExifTool - Re: .exiftool_config for biological data

Posted on Tue Nov 27 15:29:58 2007 by exiftool in response to 6531 (See the whole thread of 22)
Re: .exiftool_config for biological data
Hi Eddie,

There is a "donate" button available from the ExifTool home page.

Here is your ".ExifTool_config" file:

%Image::ExifTool::UserDefined::Biology = ( GROUPS => { 0 => 'XMP', 1 => 'XMP-bio', 2 => 'Image' }, NAMESPACE => { 'bio' => 'http://eddie.dunbar.com/bio/1.0/' }, WRITABLE => 'string', Taxon => { }, TaxonCode => { }, Phylogeny => { }, Order => { }, Family => { }, Genus => { }, Species => { }, CommonName => { }, Description => { }, IdentificationBy => { }, Country => { }, State => { }, County => { }, CountyCode => { }, Locality => { }, LocalityCode => { }, Sublocation => { }, GPS => { }, Importance => { }, Control => { }, Range => { }, FlightPeriod => { }, Food => { }, Development => { }, PhotoQuality => { }, Aspect => { }, Disposition => { }, Photographer => { }, Comments => { }, ); # The %Image::ExifTool::UserDefined hash defines new tags to be added # to existing tables. %Image::ExifTool::UserDefined = ( # new XMP namespaces (ie. XMP-bio) must be added to the Main XMP table: 'Image::ExifTool::XMP::Main' => { bio => { SubDirectory => { TagTable => 'Image::ExifTool::UserDefined::Biology', }, }, }, ); 1; #end

And here is your arguments file (let's call it "my.args"):

-XMP:Taxon=Coccinella_californica -XMP:TaxonCode=00471 -XMP:Phylogeny=Insecta -XMP:Phylogeny=Coleoptera -XMP:Phylogeny=Coccinellidae -XMP:Phylogeny=Coccinella californica -XMP:Order=Coleoptera -XMP:Family=Coccinellidae -XMP:Genus=Coccinella -XMP:Species=Coccinella californica -XMP:CommonName=California ladybird beetle -XMP:Description=color: burnt orange; pronotum black, forward margins with white square; size:5-7 +mm -XMP:IdentificationBy=Eddie Dunbar -XMP:Country=USA -XMP:State=California -XMP:County=Alameda -XMP:CountyCode=01 -XMP:Locality=Oakland, Melrose District -XMP:LocalityCode=0101 -XMP:Sublocation=Congress@Ygnacio -XMP:Importance=beneficial; biocontrol of softbodied arthropods on vegetables and ornamentals -XMP:Control=none applicable -Range=California, west to the Rockies -XMP:FlightPeriod=May to November -XMP:Food=predator; aphids, scale -XMP:Development=homometabolous -XMP:PhotoQuality=5 -XMP:Aspect=head@laterum -XMP:Disposition=field photo; not collected -XMP:Photographer=Eddie Dunbar -XMP:Subject=Insecta -XMP:Subject=Coleoptera -XMP:Subject=Coccinellidae -XMP:Subject=Coccinella californica -XMP:Subject=California ladybird beetle

Once you have installed the ".ExifTool_config" file in your home directory or the exiftool directory, then you can use the following command to write all tags in the "my.args" file:

exiftool -@ my.args DIR
Where DIR is a directory containing your images. "my.args" must be in the current directory for this to work.

Note that in general it is better to use existing tags if possible instead of defining your own. This way, other software may be able to understand some of the information you have added. So I would suggest looking through the list of XMP tags to try to use as many as possible instead of defining your own. Here, I have done this for one tag, and used XMP:Subject instead of Keywords since this is the accepted place to store keywords in XMP.

Also, I have made one tag (Phylogeny) a list-type tag, which stores the values separately but combines them into a comma-delimited list when reading. You may want to do this for other tags too because it allows you to add and delete single items from a list much more easily. This is the way that XMP:Subject is defined as well.

- Phil
Direct Responses: 6546 | Write a response