ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:29 AM

Title: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by dtgriscom on 2008-12-31 17:10:23-08]

I'm trying to figure out just how Exif tags are organized. I can find docs on each of the tags, and that talks about "families" and "groups", but I can't find anything that succinctly describes the overall organization. Even more confusing it seems as if you can have multiple instances of a specific tag (e.g. after Photoshopping). It's the classic "can't see the forest for the trees".

Exactly how are tags organized? If the answer is "RTFM", would someone kindly point me to the relevant M? Or, if this isn't an appropriate forum, would someone kindly point me to an appropriate one?

Thanks,
Dan
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by exiftool on 2009-01-01 18:53:56-08]

Hi Dan,

This is the right place to ask this question.

The EXIF family 1 groups are based on the actual structure of
the EXIF information (IFD0, IFD1, ExifIFD, etc).  To understand
this, you should consult the EXIF
2.2 specification
.

Links to the documentation for this and other information types
can be found from the descriptions in the exiftool
tag
name documentation
.

Please let me know if this isn't what you meant.

- Phil
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by dtgriscom on 2009-01-01 19:33:01-08]

Thanks for your response. Unfortunately, IMHO, the EXIF 2.2 spec only contains a highly-precise description of the trees, and includes no clear description of the forest. The information's probably there, but it's lost in a swamp of details (to mix my metaphors). Even a simplified description like this doesn't provide what I need; it shows the "Exif data structure" but says nothing about how the tags are theoretically organized.

I don't need to know how to write Exif tags to an image file; there are great tools such as ExifTool for that. I'm just looking for an outline of how the tags are organized, ignoring any implementation details. Just how do tags, groups and families relate to each other? Or, what of the Exif spec would I need to know in order to understand the inputs and outputs of ExifTool's various Get/SetGroup commands?

Although I believe this description would be generally useful, my specific need is a project where I'm tagging Earth observation photos taken from the International Space Station. Each photo needs to specify two locations: the location of the camera, and the location of the target (which can be hundreds of km away from the nadir point).

I'm guessing the GPS tags would be best used for the camera (ISS) location, but where do I store the lat/lon of the center of the imaged area of Earth? Could I have a duplicate set of GPS tags, with an agreement as to which tags represent which location? Or could I actually add my own custom Exif tags (I suspect not)?
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by exiftool on 2009-01-02 00:05:44-08]

You are quite correct, the EXIF specification is quite unreadable
and doesn't give a good picture of how things are structured.
But if you need to know the details, that's where you go.

But you don't really need to understand the structure to use
ExifTool.  Just write the the EXIF group and ExifTool will handle
the structure details and put the information in the proper place.
If you need to specify the IFD explicitly, this is possible, but
you would never do this unless you understood the EXIF structure
and had a specific reason for wanting to do something different.

One of the significant pitfalls of EXIF is that the camera and image
locations are not stored separately.  If I were doing this for a living,
I would write the camera location in the EXIF GPS, and specify the
image coordinate system using GeoTIFF tags.  But this may be more
work than you are willing to do, plus ExifTool does not yet write
GeoTIFF information.

An alternative (although not strictly recommended) would be to
hijack the EXIF GPS destination coordinates to use for your image
center.

If you want to get into defining custom tags, this can be done but
you would have to go to an extensible format such as XMP for this.

- Phil
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by dtgriscom on 2009-01-02 01:04:26-08]

Thanks. I was thinking about the GPS destination coordinates as well, and might go that way.

Thanks,

Dan
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by dzurn on 2009-01-02 02:14:59-08]

That's been one of the long-term questions I've secretly harbored about the GPS tagging of photos. The GPS coordinates are those of the camera (of course) but I've not seen any good framework to simply describe the pointing direction or FOV of the resulting image.

We'd be getting pretty deep into the FOV translated to GPS coordinates, but it's obviously much harder than identifying where the camera was the minute the shutter was fired.

Darryl
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by exiftool on 2009-01-02 02:49:53-08]

Hi Darryl,

I agree that it the image coordinates (for rectilinear images)
can be derived if one knows the focal length, focal plane size, and the
six camera coordinates (the 3 position coordinates plus 3 rotation
angles).  Again, the EXIF specification falls short, and doesn't allow
for storage of these angles.  (I had thought about this a long while
back, and have even put these angles into the basic tags that I have
defined for the MIE format.)

- Phil
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by dtgriscom on 2009-01-02 13:53:06-08]

I'm sorry, but I'd like to try again to find out about Exif tag organization. Absent an overview document, I have some leading questions:

- What does it mean when there are several copies of a tag, all but the first with appended numbers? For instance, after I use Photoshop to edit an image, ExifTool returns four different "ResolutionUnit" tags, with the labels "ResolutionUnit", "ResolutionUnit (1)", "ResolutionUnit (2)" and "ResolutionUnit (3)". What does this mean in terms of the document structure? How should my software interpret the different values?

- In the ExifTool examples, there's an example of how to "delete all but EXIF tags". I thought they were ALL EXIF tags???

- What are groups? What does it mean that they have priorities? Is a specific tag always in the same group? Why are some groups "deletable"? Can I create my own groups?

- What are families? Is a specific group always contained within the same family?

- I understand that composite tag values are derived from non-composite ("real"?) tag values, but when is this done? Are composite tags stored in the file along with real tags?

- A document that specified all of this, in non-jargon English, without going into the bits and bytes of how it's all stored on disk, would be incredibly helpful. Does such a document exist? (If not, writing one as part of ExifTool's documentation would be a great idea. I'm guessing it wouldn't even need to be that long; perhaps just two or three pages.)

Thanks,

Dan
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:29 AM
[Originally posted by exiftool on 2009-01-02 20:08:20-08]

Hi Dan,

Specific questions I can answer...

Code:
   What does it mean when there are several copies of a tag,
    all but the first with appended numbers?

These are "tag keys".  For more information, read the description of
the Return Value from the
ImageInfo
function.  Given a tag key, you should use the the following
functions to obtain more information about the tag:

GetTagName

GetValue

GetDescription

GetGroup

GetTagID

Specifically, GetGroup() is the function that will tell you about
where the tag came from in the file.

Code:
   In the ExifTool examples, there's an example of how to
    "delete all but EXIF tags". I thought they were ALL EXIF tags???

No.  I think this is where most of your confusion is coming from.
ExifTool handles many different types of information besides EXIF.
The common other types are IPTC and XMP, but there is so much
more than that, including support of the proprietary makernote
formats for many cameras (none of which are part of the EXIF
specification).

Code:
   What are groups?

I suggest you read the documentation for the
GetGroup
and
GetGroups

Code:
   What does it mean that they have priorities?

If you write a tag without specifying the group, then ExifTool will
choose a group for you according to the pre-determined priorities.
The priorities are only necessary in the case where a tag with the
same name exists in more than one group.

Code:
   Is a specific tag always in the same group?

A tag with the same name may exist in many different groups.

Code:
   Why are some groups "deletable"? Can I create my own groups?

When the documentation calls a group "deletable", it means that you
can delete all of the tags in this group (using SetNewValue('GROUP:all')).
You can create your own groups for some information types if you create
user-defined tags.  In the sample config file, there is an example of creating
an XMP-xxx group.

Code:
   I understand that composite tag values are derived from
    non-composite ("real"?) tag values, but when is this done?
    Are composite tags stored in the file along with real tags?

This is done after all "real" tags are extracted from each processed
file.  The composite tags (and error and warning messages, etc) are
all stored in exactly the same way as any other tag.  You need to look
at the family 1 group names to be able to tell what type of tag it is.

Code:
   A document that specified all of this, in non-jargon English,
    without going into the bits and bytes of how it's all stored on disk,
    would be incredibly helpful. [...]

All of the details can of course be found in the ExifTool documentation,
but it seems as if you are looking for an overview which gives an
orientation on the subject of meta information and how it relates
to ExifTool.  I have not written such a document, but I agree that
it may be useful if I do.  I think that if you understood
the meta information formats (independent of ExifTool), you
would have a much easier time understanding what ExifTool does.
There may well be documents available on the internet which
provide this type of overview.

- Phil
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:30 AM
[Originally posted by ying on 2009-01-30 21:48:06-08]

How can I create a user defined tag(Vehicle) a list type tag?
Code:
%Image::ExifTool::UserDefined::xxx = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-xxx', 2 => 'Image' },
    NAMESPACE => { 'xxx' => 'http://www.xxx.com/xxx/1.0/' },
    WRITABLE => 'string',
    Vehicle=> { },
    PERSONNE => { },
);
Thanks,
Ying
Title: Re: Exif tag organization?
Post by: Archive on May 12, 2010, 08:54:30 AM
[Originally posted by exiftool on 2009-01-31 20:28:22-08]

See the NewXMPxxxTag3 example in the sample config file.