under.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Under the Hood</title>
  6. <link rel=stylesheet type='text/css' href='style.css' title='Style'>
  7. <style type="text/css">
  8. <!--
  9. pre { margin: 0 }
  10. ol.index { margin: 0; padding: 0 0 0 2em }
  11. -->
  12. </style>
  13. </head>
  14. <body>
  15. <div class='index'>
  16. <a href="#overview">Overview</a>
  17. <br><a href="#conversions">Value Conversions</a>
  18. <br><a href="#philophies">Underlying Philosophies</a>
  19. </div>
  20. <h1 class='up'>"Under the Hood" of ExifTool</h1>
  21. <p>This page is a work in progress, and will be used to explain some details
  22. of ExifTool's inner workings.</p>
  23. <a name="overview"></a>
  24. <h2>Overview of ExifTool</h2>
  25. <p>Below is a diagram showing the flow of information for the exiftool
  26. application. Indicated outside the boxes on the diagram are some command-line
  27. options associated with the various stages of processing. All of these options
  28. are directly associated with options or function calls available via the API
  29. (Application Programming Interface), with the exception of the output text
  30. formatting which is handled at the application level.</p>
  31. <center><img src="overview.png" alt="ExifTool Overview" width="680" height="460"></center>
  32. <p>The information flow is separated into two distinct modes: 1)
  33. <span class=blu>Reading or extracting information</span>, and 2)
  34. <span class=red>Writing or editing</span>. The application runs in
  35. <b class=blu>read</b> mode by default, but switches to <b class=red>write</b> mode
  36. if a new value is assigned to any tag (via "<code>-TAG=</code>",
  37. "<code>-tagsFromFile</code>", "<code>-geotag</code>", "<code>-csv=</code>" or
  38. "<code>-json=</code>" on the command line).</p>
  39. <a name="conversions"></a>
  40. <h2>Value Conversions</h2>
  41. <p>When ExifTool reads or writes the value of a tag, there are 3 separate
  42. conversions applied to each value, resulting in 4 different levels for the value
  43. of each tag. By default, users interact only with the human-readable
  44. ("<b>PrintConv</b>") value, but other levels are exposed through various exiftool
  45. options:</p>
  46. <ol start=3><li>The "<b>PrintConv</b>" value is the final human-readable value
  47. which has been converted for display. Often, the "PrintConv" conversion will
  48. translate numbers into words for better readability. The <code>-lang</code>
  49. (Lang) option is used to specify the language for this conversion, and the
  50. <code>-c</code> and <code>-d</code> (CoordFormat and DateFormat) options specify
  51. this formatting for GPS coordinates and date/time values.</li></ol>
  52. <ol start=2><li>The "<b>ValueConv</b>" value is a numerical value, suitable for
  53. use in calculations. Typically, this value is converted to standard units (eg.
  54. degrees, meters, or seconds) to make calculations simpler. This value is
  55. returned for all tags when the <code>-n</code> option is used, or for individual
  56. tags by suffixing the tag name with a <code>#</code> character.</li></ol>
  57. <ol start=1><li>The "<b>Raw</b>" value is the value after initial formatting is
  58. applied to the binary data from the file. Most tags have no separate "ValueConv"
  59. conversion, so for these tags the "Raw" value is the same as the "ValueConv"
  60. value. This value may be seen by using the <code>-v</code> option.</li></ol>
  61. <ol start=0><li>The "<b>Binary</b>" value is actual binary data stored in the
  62. file. This data is displayed in hexadecimal form with the <code>-v3</code>
  63. option, or by using the <code>-htmlDump</code> feature. Note that this value is
  64. not related to the <code>-b</code> (<code>-binary</code>) option, which actually
  65. returns the "ValueConv" value and is used for tags where this value can not be
  66. presented in a simple text format. The Writable column in the
  67. <a href="TagNames/index.html">Tag Name documentation</a>
  68. gives the format of this binary data for writable tags.</li></ol>
  69. <p>Below are some examples of these different values for a few tags:</p>
  70. <blockquote><table class=norm>
  71. <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>
  72. <tr align='center'><td>Orientation</td><td>Horizontal (normal)</td><td>1</td><td>1</td><td><pre>00 01</pre></td></tr>
  73. <tr align='center'><td>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>
  74. <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>
  75. <tr align='center'><td>ExposureTime</td><td>1/30</td><td>0.03333333333</td><td>0.03333333333<br>(1/30)</td>
  76. <td><pre>00 00 00 01 00 00 00 1e</pre></td></tr>
  77. <tr align='center'><td>ShutterSpeedValue</td><td>1/30</td><td>0.0333333334629176</td><td>4.90689059<br>(19868/4049)</td>
  78. <td><pre>00 00 4d 9c 00 00 0f d1</pre></td></tr>
  79. </table></blockquote>
  80. <a name="philophies"></a>
  81. <h2>Underlying Philosophies</h2>
  82. <p>You have the right to know about the metadata contained in your images. A main
  83. goal of the Exiftool project is to make this information freely available, both to
  84. the general public and as a resource for other developers.</p>
  85. <p>In the design of exiftool, there have been a number of underlying philosophies
  86. which have helped to influence the overall development:</p>
  87. <ol>
  88. <li>Make <a href="ExifTool.html">Image::ExifTool</a> as independent as possible
  89. from other libraries to make it portable and easy to install. (Portable to
  90. a wide range of systems and Perl versions.)</li>
  91. <li>Keep the interface simple for simple tasks (sometimes at the expense of making
  92. it more complicated for complex tasks).</li>
  93. <li>The <a href="ExifTool.html#Methods">API functions</a> should be isolated from
  94. the details of the metadata formats (otherwise the interface turns into a giant
  95. hairball, like the metadata).</li>
  96. <li>Maintain flexibility to allow users the freedom to do what they want.</li>
  97. <li>Design the code to be efficient for batch processing, even if it increases the
  98. initial overhead.</li>
  99. <li>When writing files, remember 3 things: 1) data integrity, 2) data integrity, and
  100. 3) data integrity. If you can't do it right, don't do it at all.</li>
  101. <li>If possible, recognize file types by their structure, not by their extension.</li>
  102. <li>Maintain backward compatibility when making changes to the ExifTool API or
  103. command line application.</li>
  104. </ol>
  105. <hr>
  106. <i>Created Jun. 24, 2009</i><br>
  107. <i>Last revised Dec. 24, 2013</i>
  108. <p class='lf'><a href="index.html">&lt;-- Back to ExifTool home page</a></p>
  109. </body>
  110. </html>