File: under.html

package info (click to toggle)
libimage-exiftool-perl 11.16-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,024 kB
  • sloc: perl: 245,177; xml: 120; makefile: 9
file content (137 lines) | stat: -rw-r--r-- 7,298 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
  <title>Under the Hood</title>
<link rel=stylesheet type='text/css' href='style.css' title='Style'>
<style type="text/css">
<!--
pre         { margin: 0 }
ol.index    { margin: 0; padding: 0 0 0 2em }
-->
</style>
</head>
<body>
<div class='index'>
<a href="#overview">Overview</a>
<br><a href="#conversions">Value Conversions</a>
<br><a href="#philophies">Underlying Philosophies</a>
</div>

<h1 class='up'>"Under the Hood" of ExifTool</h1>

<p>This page is a work in progress, and will be used to explain some details
of ExifTool's inner workings.</p>

<a name="overview"></a>
<h2>Overview of ExifTool</h2>

<p>Below is a diagram showing the flow of information for the exiftool
application.  Indicated outside the boxes on the diagram are some command-line
options associated with the various stages of processing.  All of these options
are directly associated with options or function calls available via the API
(Application Programming Interface), with the exception of the output text
formatting which is handled at the application level.</p>

<center><img src="overview.png" alt="ExifTool Overview" width="680" height="460"></center>

<p>The information flow is separated into two distinct modes: 1)
<span class=blu>Reading or extracting information</span>, and 2)
<span class=red>Writing or editing</span>.  The application runs in
<b class=blu>read</b> mode by default, but switches to <b class=red>write</b> mode
if a new value is assigned to any tag (via "<code>-TAG=</code>",
"<code>-tagsFromFile</code>", "<code>-geotag</code>", "<code>-csv=</code>" or
"<code>-json=</code>" on the command line).</p>

<a name="conversions"></a>
<h2>Value Conversions</h2>
<p>When ExifTool reads or writes the value of a tag, there are 3 separate
conversions applied to each value, resulting in 4 different levels for the value
of each tag.  By default, users interact only with the human-readable
("<b>PrintConv</b>") value, but other levels are exposed through various exiftool
options:</p>

<ol start=3><li>The "<b>PrintConv</b>" value is the final human-readable value
which has been converted for display.  Often, the "PrintConv" conversion will
translate numbers into words for better readability.  The <code>-lang</code>
(Lang) option is used to specify the language for this conversion, and the
<code>-c</code> and <code>-d</code> (CoordFormat and DateFormat) options specify
this formatting for GPS coordinates and date/time values.</li></ol>

<ol start=2><li>For numerical values, the "<b>ValueConv</b>" value is a
machine-readable value suitable for use in calculations, typically converted to
standard units (eg. degrees, meters, or seconds).  For date/time values the
standard EXIF date/time format is used ("YYYY:mm:dd HH:MM:SS" plus decimal
seconds and time zone if they exist).  For tags which are a closed choice of
string, this is the stored value of the string.  The ValueConv value is
returned for all tags when the <code>-n</code> option is used, or for individual
tags by suffixing the tag name with a <code>#</code> character.</li></ol>

<ol start=1><li>The "<b>Raw</b>" value is the value after initial formatting is
applied to the binary data from the file.  Most tags have no separate "ValueConv"
conversion, so for these tags the "Raw" value is the same as the "ValueConv"
value.  This value may be seen by using the <code>-v</code> option.</li></ol>

<ol start=0><li>The "<b>Binary</b>" value is the actual binary data stored in the
file.  This data is displayed in hexadecimal form with the <code>-v3</code>
option, or by using the <code>-htmlDump</code> feature.  Note that this value is
not related to the <code>-b</code> (<code>-binary</code>) option, which actually
returns the "ValueConv" value and is used for tags where this value can not be
presented in a simple text format.  The Writable column in the
<a href="TagNames/index.html">Tag Name documentation</a>
gives the format of this binary data for writable tags.</li></ol>

<p>Below are some examples of these different values for a few tags:</p>

<blockquote><table class=norm>
<tr><th>Tag</th><th>3.&nbsp;PrintConv</th><th>2.&nbsp;ValueConv</th><th>1.&nbsp;Raw</th><th>0.&nbsp;Binary</th></tr>
<tr align='center'><td>EXIF:Orientation</td><td>Horizontal (normal)</td><td>1</td><td>1</td><td><pre>00 01</pre></td></tr>
<tr align='center'><td>EXIF:GPSLatitude</td><td>45 deg 20' 11.00"</td><td>45.3363888888889</td><td>45 20 11<br>(45/1 20/1 11/1)</td>
  <td><pre>00 00 00 2d 00 00 00 01<br>00 00 00 14 00 00 00 01<br>00 00 00 0b 00 00 00 01</pre></td></tr>
<tr align='center'><td>XMP:GPSLatitude</td><td>45 deg 20' 11.00"</td><td>45.3363888888889</td><td>45,20.183333N</td>
  <td>"45,20.183333N"</td></tr>
<tr align='center'><td>EXIF:ExposureTime</td><td>1/30</td><td>0.03333333333</td><td>0.03333333333<br>(1/30)</td>
  <td><pre>00 00 00 01 00 00 00 1e</pre></td></tr>
<tr align='center'><td>EXIF:ShutterSpeedValue</td><td>1/30</td><td>0.0333333334629176</td><td>4.90689059<br>(19868/4049)</td>
  <td><pre>00 00 4d 9c 00 00 0f d1</pre></td></tr>
<tr align='center'><td>EXIF:ModifyDate</td><td>(set by <code>-d</code> option)</td><td>2016:11:25 11:56:39</td><td>2016:11:25 11:56:39</td>
  <td>"2016:11:25 11:56:39\0"</td></tr>
<tr align='center'><td>XMP:ModifyDate</td><td>(set by <code>-d</code> option)</td><td>2016:11:25 11:56:39.00-05:00</td><td>2016-11-25T11:56:39.00-05:00</td>
  <td>"2016-11-25T11:56:39.00-05:00"</td></tr>
</table></blockquote>

<a name="philophies"></a>
<h2>Underlying Philosophies</h2>

<p>You have the right to know about the metadata contained in your images.  A main
goal of the Exiftool project is to make this information freely available, both to
the general public and as a resource for other developers.</p>

<p>In the design of exiftool, there have been a number of underlying philosophies
which have helped to influence the overall development:</p>

<ol>
<li>Make <a href="ExifTool.html">Image::ExifTool</a> as independent as possible
    from other libraries to make it portable and easy to install.  (Portable to
    a wide range of systems and Perl versions.)</li>
<li>Keep the interface simple for simple tasks (sometimes at the expense of making
    it more complicated for complex tasks).</li>
<li>The <a href="ExifTool.html#Methods">API functions</a> should be isolated from
    the details of the metadata formats (otherwise the interface turns into a giant
    hairball, like the metadata).</li>
<li>Maintain flexibility to allow users the freedom to do what they want.</li>
<li>Design the code to be efficient for batch processing, even if it increases the
    initial overhead.</li>
<li>When writing files, remember 3 things: 1) data integrity, 2) data integrity, and
    3) data integrity.  If you can't do it right, don't do it at all.</li>
<li>If possible, recognize file types by their structure, not by their extension.</li>
<li>Maintain backward compatibility when making changes to the ExifTool API or
    command line application.</li>
</ol>

<hr>
<i>Created Jun. 24, 2009</i><br>
<i>Last revised Nov. 25, 2016</i>
<p class='lf'><a href="index.html">&lt;-- Back to ExifTool home page</a></p>
</body>
</html>