<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pario TechnoBlob &#187; EXIF</title>
	<atom:link href="http://pario.no/tag/exif/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Copy EXIF information from one file to another</title>
		<link>http://pario.no/2011/01/08/copy-exif-information-from-one-file-to-another/</link>
		<comments>http://pario.no/2011/01/08/copy-exif-information-from-one-file-to-another/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 21:01:47 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[exiftool]]></category>

		<guid isPermaLink="false">http://pario.no/?p=1466</guid>
		<description><![CDATA[This is a short post about how to duplicate or copy the EXIF information from one file to another using exiftool. The command comes handy when you have one image with EXIF information and you would like another image to have the exact EXIF information. exiftool -TagsFromFile CopyFromFile.NEF ToFile.JPG This works in both Windows and [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short post about how to duplicate or copy the EXIF information from one file to another using exiftool.<br />
The command comes handy when you have one image with EXIF information and you would like another image to have the exact EXIF information. </p>
<pre>
exiftool -TagsFromFile CopyFromFile.NEF ToFile.JPG</pre>
<p>This works in both Windows and Linux.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMTEvMDEvMDgvY29weS1leGlmLWluZm9ybWF0aW9uLWZyb20tb25lLWZpbGUtdG8tYW5vdGhlci88d3B0Yj5Db3B5IEVYSUYgaW5mb3JtYXRpb24gZnJvbSBvbmUgZmlsZSB0byBhbm90aGVyPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2011/01/08/copy-exif-information-from-one-file-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename files by wildcard pattern and correct the EXIF timestamp metadata</title>
		<link>http://pario.no/2008/09/02/rename-files-by-wildcard-pattern-and-correct-the-exif-timestamp-metadata/</link>
		<comments>http://pario.no/2008/09/02/rename-files-by-wildcard-pattern-and-correct-the-exif-timestamp-metadata/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 16:05:58 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[exiv2]]></category>
		<category><![CDATA[jhead]]></category>
		<category><![CDATA[JPG]]></category>
		<category><![CDATA[mmv]]></category>
		<category><![CDATA[NEF]]></category>
		<category><![CDATA[Nikon]]></category>
		<category><![CDATA[rename]]></category>
		<category><![CDATA[Sony]]></category>

		<guid isPermaLink="false">http://pario.no/?p=467</guid>
		<description><![CDATA[This is a little script I&#8217;ve written to correct all my image files since the EXIF timestamp information is one hour out of sync. The filenames have been renamed to comply to the EXIF information and has to be renamed again because of the one hour scew. The filename can look something like this 20080102-1201_DSC_0910.JPG [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little script I&#8217;ve written to correct all my image files since the EXIF timestamp information is one hour out of sync. The filenames have been renamed to comply to the EXIF information and has to be renamed again because of the one hour scew. The filename can look something like this 20080102-1201_DSC_0910.JPG where the name is built up like YYYYMMDD-HHMM_Original_Filename.JPG<br />
<strong>Remember to backup your imagefiles before you continue. You have been warned!</strong></p>
<h2>Rename files using wildcard pattern</h2>
<p>This is the files we are going to rename</p>
<pre>
20080102-1201_DSC_0910.JPG
20080105-1923_DSC_1006.JPG
20080111-1220_DSC00189.JPG
20080122-0929_DSC00190.JPG</pre>
<p>The <strong>mmv</strong> command is a command that lets you move/copy/append/link multiple files by wildcard patterns. It can be installed in Debian (or Debian based distributions like Ubuntu) by issuing the command</p>
<pre>
# aptitude install mmv</pre>
<p>Now rename the files back to their original name</p>
<pre>
# mmv "*_DSC*" "DSC#2"</pre>
<p>The result after this operation looks like this</p>
<pre>
DSC_0910.JPG
DSC_1006.JPG
DSC_1179.JPG
DSC_1302.JPG
DSC_1587.JPG</pre>
<h2>Correct the EXIF timestamp using exiv2</h2>
<p>Next adjust the EXIF information stored in the image files to fix the one hour difference. This can be done using different EXIF tools like <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/">exiftool</a>, but I will show you how it can be done using <a href="http://www.sentex.net/~mwandel/jhead/">jhead</a> and <a href="http://www.exiv2.org">exiv2</a>. The advantage with <strong>exiv2</strong> is that it can also handle Nikon NEF files while <strong>jhead</strong> only can prosess JPG. </p>
<p>The current timestamp can be determined as follows</p>
<pre>
# exiftool DSC_0910.JPG | grep "File Mo"</pre>
<p>The result in this case is</p>
<pre>
File Modification Date/Time : 2008:01:02 08:34:09</pre>
<h3>Adjust EXIF time info one hour forward using exiftool</h3>
<pre>
# exiftool -AllDates+=1 DSC_0910.JPG</pre>
<h3>Other tools that could have done the job</h3>
<h4>Adjust EXIF time info one hour forward using jhead</h4>
<pre>
# jhead -ta +1 DSC_0910.JPG</pre>
<p>Install the <strong>jhead</strong> package using aptitude as mentioned earlier for the mmv package</p>
<h4>Adjust EXIF time info one hour forward using exiv2</h4>
<pre>
# exiv2 ad -a 1 DSC_0910.JPG</pre>
<h2>Rename files back to YYYYMMDD-HHMM_Original_Filename.JPG</h2>
<p>It is now time to rename the files back to the YYYYMMDD-HHMM_Original_Filename.JPG format I used before this operation. This operation has been describe in a previous post named <a href="http://pario.no/2008/01/14/rename-image-files-according-to-exif-date/">Rename image files according to EXIF date</a></p>
<pre>
exiv2 -r'%Y%m%d-%H%M_:basename:' rename $(ls D*)</pre>
<h2>The script</h2>
<pre>
#!/bin/bash -x
# Needed software:
# exiftool
# exiv2
# mmv

# Script tested on Nikon D80 and Sony Cybershot DSC-W12 files

# Make a printout of how the files look like now
ls -l > repair_name_and_exif_before.txt

# Rename files to remove date formatting back to original name
mmv "*_DSC*" "DSC#2"

# Change EXIF info on JPG files (order is important)
exiftool -overwrite_original -AllDates+=1 D*.JPG
# Preserve date/time of original file when writing
exiftool -overwrite_original '-DateTimeOriginal>FileModifyDate' D*.JPG

# Change EXIF info on NEF files (order is important)
exiftool -overwrite_original -AllDates+=1 '-DateTimeOriginal>FileModifyDate' D*.NEF
# Preserve date/time of original file when writing
exiftool -overwrite_original '-DateTimeOriginal>FileModifyDate' D*.NEF

# Rename files back to date formatting (YYYYMMDD-HHMM_Filename) based on the new EXIF info
exiv2 -r'%Y%m%d-%H%M_:basename:' rename $(ls D*)

# Make a printout of how the files look like after conversion
ls -l > repair_name_and_exif_after.txt
</pre>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/www.sno.phy.queensu.ca\/~phil\/exiftool\/","http:\/\/www.sentex.net\/~mwandel\/jhead\/","http:\/\/www.exiv2.org"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDkvMDIvcmVuYW1lLWZpbGVzLWJ5LXdpbGRjYXJkLXBhdHRlcm4tYW5kLWNvcnJlY3QtdGhlLWV4aWYtdGltZXN0YW1wLW1ldGFkYXRhLzx3cHRiPlJlbmFtZSBmaWxlcyBieSB3aWxkY2FyZCBwYXR0ZXJuIGFuZCBjb3JyZWN0IHRoZSBFWElGIHRpbWVzdGFtcCBtZXRhZGF0YTx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/09/02/rename-files-by-wildcard-pattern-and-correct-the-exif-timestamp-metadata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename image files according to EXIF date</title>
		<link>http://pario.no/2008/01/14/rename-image-files-according-to-exif-date/</link>
		<comments>http://pario.no/2008/01/14/rename-image-files-according-to-exif-date/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 07:05:46 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[D80]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[exiv2]]></category>
		<category><![CDATA[jhead]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[ms-dos]]></category>
		<category><![CDATA[NEF]]></category>
		<category><![CDATA[Nikon]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://pario.no/2008/01/14/rename-image-files-according-to-exif-date/</guid>
		<description><![CDATA[This rename trick can be run in Windows, Linux and even Mac since the commandline program I&#8217;m going to use, exiv2, is available in all three platforms. Rename all image files in current folder to the format YYYYMMDDHHMM_Filename.EXT This has been tested on my Nikon D80 JPEG and NEF image files. Linux exiv2 -r'%Y%m%d-%H%M_:basename:' rename [...]]]></description>
			<content:encoded><![CDATA[<p>This rename trick can be run in Windows, Linux and even Mac since the commandline program I&#8217;m going to use, <a href="http://www.exiv2.org/">exiv2</a>, is available in all three platforms. Rename all image files in current folder to the format YYYYMMDDHHMM_Filename.EXT</p>
<p>This has been tested on my Nikon D80 JPEG and NEF image files.</p>
<p><strong>Linux</strong></p>
<pre>
exiv2 -r'%Y%m%d-%H%M_:basename:' rename $(ls)</pre>
<p><strong>Windows (from the command prompt)</strong></p>
<pre>
exiv2.exe -r %Y%m%d-%H%M_:basename: rename d*</pre>
<p><strong>Windows (in a MS-DOS batch file)</strong></p>
<pre>
exiv2.exe -r %%Y%%m%%d-%%H%%M_:basename: rename d*</pre>
<p>You have to add an extra % if you are going to use exiv2 in a Windows batch file, because % in batch files is treated as a variable and not as a switch to exiv2. </p>
<p>These examples require that you have access to the <strong>exiv2</strong> program from the current folder.</p>
<p><strong>Result</strong><br />
Now my image files have names like</p>
<pre>
20071022-1202_DSC_9727.JPG
20071022-1202_DSC_9727.NEF</pre>
<p><strong>Change in workflow</strong><br />
Since I rename all my files in the format YYYYMMDD-HHMM_Filename I&#8217;ve included it in my image &#8220;workflow&#8221; (a simple MS-DOS batch file) I wrote about in <a href="http://pario.no/2007/05/23/rotate-images-depending-on-the-exif-orientation-tag/">Rotate images depending on the EXIF orientation post</a>.</p>
<p>This has been tested successfully on the Windows exiv2 version 0.16</p>
<p><a href="http://pario.no/wp-content/uploads/2008/01/rotate.bat" title="rotate.bat">The new batch file can be downloaded here</a>.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/www.exiv2.org\/"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDEvMTQvcmVuYW1lLWltYWdlLWZpbGVzLWFjY29yZGluZy10by1leGlmLWRhdGUvPHdwdGI%2BUmVuYW1lIGltYWdlIGZpbGVzIGFjY29yZGluZyB0byBFWElGIGRhdGU8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/01/14/rename-image-files-according-to-exif-date/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Number of shots taken by Nikon D80 camera</title>
		<link>http://pario.no/2007/11/22/number-of-shots-taken-by-nikon-d80-camera/</link>
		<comments>http://pario.no/2007/11/22/number-of-shots-taken-by-nikon-d80-camera/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 22:43:07 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[D80]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[exiv2]]></category>
		<category><![CDATA[JPG]]></category>
		<category><![CDATA[Nikon]]></category>

		<guid isPermaLink="false">http://pario.no/2007/11/22/number-of-shots-taken-by-nikon-d80-camera/</guid>
		<description><![CDATA[The Nikon D80 camera contains a EXIF tag value that counts the number shots taken Tag (hex) Tag (dec) IFD Key Type Tag description 0x00a7 167 Makernote Exif.Nikon3.ShutterCount Long Number of shots taken by camera This can be extracted by running the following command exiv2 -pt picturename.JPG ... Exif.Nikon3.ShutterCount Long 1 5263 This example shows [...]]]></description>
			<content:encoded><![CDATA[<p>The Nikon D80 camera contains a EXIF tag value that counts the number shots taken</p>
<table border="1" cellspacing="0">
<tr>
<th>Tag (hex)</th>
<th>Tag (dec)</th>
<th>IFD</th>
<th>Key</th>
<th>Type</th>
<th>Tag description</th>
</tr>
<tr>
<td>0x00a7</td>
<td>167</td>
<td>Makernote</td>
<td>Exif.Nikon3.ShutterCount</td>
<td>Long</td>
<td>Number of shots taken by camera</td>
</tr>
</table>
<p>This can be extracted by running the following command</p>
<pre>
exiv2 -pt picturename.JPG
...
Exif.Nikon3.ShutterCount                     Long        1  5263</pre>
<p>This example shows that there have been 5263 shots taken.</p>
<p>I guess this EXIF tag exists on Nikon D40x, D60 and D70 also, but this is not verified.</p>
<p>More Nikon specific EXIF tags can be found on <a href="http://www.exiv2.org/tags-nikon.html">http://www.exiv2.org/tags-nikon.html</a></p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/www.exiv2.org\/tags-nikon.html"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTEvMjIvbnVtYmVyLW9mLXNob3RzLXRha2VuLWJ5LW5pa29uLWQ4MC1jYW1lcmEvPHdwdGI%2BTnVtYmVyIG9mIHNob3RzIHRha2VuIGJ5IE5pa29uIEQ4MCBjYW1lcmE8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/11/22/number-of-shots-taken-by-nikon-d80-camera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strip EXIF tags from JPG files</title>
		<link>http://pario.no/2007/11/18/strip-exif-tags-from-jpg-files/</link>
		<comments>http://pario.no/2007/11/18/strip-exif-tags-from-jpg-files/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 23:46:33 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[jhead]]></category>
		<category><![CDATA[JPG]]></category>

		<guid isPermaLink="false">http://pario.no/2007/11/18/strip-exif-tags-from-jpg-file/</guid>
		<description><![CDATA[Sometimes it&#8217;s a good idea to remove the hidden data a JPG file contains, like when you publish picures on the Internet. An easy way to remove all EXIF-tags from your JPG files is to run the command using jhead jhead -purejpg *.jpg]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s a good idea to remove the hidden data a JPG file contains, like when you publish picures on the Internet.<br />
An easy way to remove all EXIF-tags from your JPG files is to run the command using <a href="http://www.sentex.ca/~mwandel/jhead/">jhead</a><br />
<code><br />
jhead -purejpg *.jpg</code></p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/www.sentex.ca\/~mwandel\/jhead\/"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTEvMTgvc3RyaXAtZXhpZi10YWdzLWZyb20tanBnLWZpbGVzLzx3cHRiPlN0cmlwIEVYSUYgdGFncyBmcm9tIEpQRyBmaWxlczx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/11/18/strip-exif-tags-from-jpg-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

