<?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; NEF</title>
	<atom:link href="http://pario.no/tag/nef/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Wed, 14 Jul 2010 12:12:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<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>dcraw examples</title>
		<link>http://pario.no/2007/08/05/dcraw-examples/</link>
		<comments>http://pario.no/2007/08/05/dcraw-examples/#comments</comments>
		<pubDate>Sun, 05 Aug 2007 20:50:17 +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[dcraw]]></category>
		<category><![CDATA[NEF]]></category>
		<category><![CDATA[Nikon]]></category>
		<category><![CDATA[tiff]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/08/05/dcraw-eksempler/</guid>
		<description><![CDATA[dcraw is a linux/Windows command line tool. It can convert RAW-files and that does also include Nikons NEF-files. Raw photo decoder "dcraw" v8.73 by Dave Coffin, dcoffin a cybercom o net Usage: dcraw [OPTION]... [FILE]... -v Print verbose messages -c Write image data to standard output -e Extract embedded thumbnail image -i Identify files without [...]]]></description>
			<content:encoded><![CDATA[<p><strong>dcraw</strong> is a linux/Windows command line tool. It can convert RAW-files and that does also include Nikons NEF-files.</p>
<pre>
Raw photo decoder "dcraw" v8.73
by Dave Coffin, dcoffin a cybercom o net

Usage:  dcraw [OPTION]... [FILE]...

-v        Print verbose messages
-c        Write image data to standard output
-e        Extract embedded thumbnail image
-i        Identify files without decoding them
-i -v     Identify files and show metadata
-z        Change file dates to camera timestamp
-w        Use camera white balance, if possible
-a        Average the whole image for white balance
-A <x> Average a grey box for white balance
-r <r> Set custom white balance
-C </r><r>  Correct chromatic aberration
-b <num>  Adjust brightness (default = 1.0)
-n </num><num>  Set threshold for wavelet denoising
-k </num><num>  Set black point
-K <file> Subtract dark frame (16-bit raw PGM)
-H [0-9]  Highlight mode (0=clip, 1=unclip, 2=blend, 3+=rebuild)
-t [0-7]  Flip image (0=none, 3=180, 5=90CCW, 6=90CW)
-o [0-5]  Output colorspace (raw,sRGB,Adobe,Wide,ProPhoto,XYZ)
-o </file><file> Apply output ICC profile from file
-p </file><file> Apply camera ICC profile from file or "embed"
-d        Document mode (no color, no interpolation)
-D        Document mode without scaling (totally raw)
-j        Don't stretch or rotate raw pixels
-q [0-3]  Set the interpolation quality
-h        Half-size color image (twice as fast as "-q 0")
-f        Interpolate RGGB as four colors
-s [0-99] Select a different raw image from the same file
-4        Write 16-bit linear instead of 8-bit with gamma
-T        Write TIFF instead of PPM
</file></num></r></x></pre>
<p><strong>Create a TIFF file and use the cameras White Balance (WB)</strong></p>
<pre>
dcraw -w -T DSC_8119.NEF</pre>
<p><strong>Create a TIFF file and use the average White Balance (WB) on the picture</strong></p>
<pre>
dcraw -a -T DSC_8119.NEF</pre>
<p><strong>Set the filedate to be the same as the picture date according to the EXIF information</strong></p>
<pre>
dcraw -z filnavn</pre>
<p><strong>Options I often use</strong></p>
<pre>
dcraw.exe -v -w -H 2 -T DSC_4228.NEF</pre>
<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 = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDgvMDUvZGNyYXctZXhhbXBsZXMvPHdwdGI%2BZGNyYXcgZXhhbXBsZXM8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/08/05/dcraw-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell scripts for archiving digital photos in directories by month</title>
		<link>http://pario.no/2007/05/15/199/</link>
		<comments>http://pario.no/2007/05/15/199/#comments</comments>
		<pubDate>Tue, 15 May 2007 07:01:16 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[egrep]]></category>
		<category><![CDATA[exiftags]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[JPG]]></category>
		<category><![CDATA[metacam]]></category>
		<category><![CDATA[NEF]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/05/15/199/</guid>
		<description><![CDATA[This is my version of the shell script &#8220;Shell scripts for archiving digital photos in directories by date&#8220;. It utilizes the exiftags command available in most linux distributions like Gentoo and debian Linux. Though the metacam program is also usefull since it can read Nikon NEF-files. Here&#8217;s an example of a directory tree they create: [...]]]></description>
			<content:encoded><![CDATA[<p>This is my version of the shell script &#8220;<a href="http://pario.no/wordpress/2007/05/15/shell-scripts-for-archiving-digital-photos-in-directories-by-date/">Shell scripts for archiving digital photos in directories by date</a>&#8220;. It utilizes  the <strong>exiftags</strong> command available in most linux distributions like Gentoo and debian Linux. Though the <strong>metacam</strong> program is also usefull since it can read Nikon <strong>NEF</strong>-files.</p>
<p>Here&#8217;s an example of a directory tree they create:</p>
<pre>
2006
  2006-10
       IMG_48324.JPG
       IMG_48325.JPG
       IMG_48326.JPG
       IMG_48331.JPG
       IMG_48333.JPG
       IMG_48334.JPG
       IMG_48337.JPG
  2006-11
       IMG_48338.JPG
  ...etc...</pre>
<p><strong>move-digiphotos</strong><br />
This bash script (move-digifotos) scans EXIF tags from .JPG files in current directory with <a href="http://freshmeat.net/projects/metacam/">metacam</a>, creates necessary directories under <strong>$BASEDIR</strong> and moves the files in them:</p>
<pre>
#!/bin/bash

# Reads EXIF creation date from all .JPG files in the
# current directory and moves them carefully under
#
#   $BASEDIR/YYYY/YYYY-MM/YYYY-MM-DD/
#
# ...where 'carefully' means that it does not overwrite
# differing files if they already exist and will not delete
# the original file if copying fails for some reason.
#
# It DOES overwrite identical files in the destination directory
# with the ones in current, however.
#
# This script was originally written and put into
# Public Domain by Jarno Elonen <elonen>; in June 2003.
# Feel free to do whatever you like with it.

BASEDIR=/home/backup/test

find -maxdepth 1 -name "*.JPG" | while read x; do
DATE=`exiftags "$x" | \
   egrep "^[ t]*Image Created:" | \
   sed -r "s/Image Created: ([0-9:]*).*/\1/"`
if [ ! -z "$DATE" ];
then
    YEAR=`echo $DATE | sed -r "s/([0-9]*):([0-9]*):([0-9]*)/\\1/"`
    MONTH=`echo $DATE | sed -r "s/([0-9]*):([0-9]*):([0-9]*)/\\2/"`
    if [ "$YEAR" -gt 0 ] &amp; [ "$MONTH" -gt 0 ]
    then
    INSTDIR=${BASEDIR}/${YEAR}/${YEAR}-${MONTH}
    install -d "$INSTDIR"
    INSTFILE="$INSTDIR/$x"
    if [ -e "$INSTFILE" ] &amp;&amp; ! cmp -s "$x" "$INSTFILE"
    then
        echo "WARNING: '$INSTFILE' exists already and is different from '$x'."
    else
        echo "Moving '$x'"
        cp -ax "$x" "$INSTFILE"
        if ! cmp -s "$x" "$INSTFILE"
        then
        echo "WARNING: copying failed somehow, will not delete original '$x'"
        else
        rm -f "$x"
        fi
    fi
    else
    echo "WARNING: '$x' doesn't contain date."
    fi
else
    echo "WARNING: '$x' doesn't contain date."
fi
done
</pre>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/freshmeat.net\/projects\/metacam\/"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDUvMTUvMTk5Lzx3cHRiPlNoZWxsIHNjcmlwdHMgZm9yIGFyY2hpdmluZyBkaWdpdGFsIHBob3RvcyBpbiBkaXJlY3RvcmllcyBieSBtb250aDx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/05/15/199/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to download pictures from camera and rename them etc</title>
		<link>http://pario.no/2007/03/13/script-to-dowload-pictures-from-camera-and-rename-them-etc/</link>
		<comments>http://pario.no/2007/03/13/script-to-dowload-pictures-from-camera-and-rename-them-etc/#comments</comments>
		<pubDate>Tue, 13 Mar 2007 12:52:50 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dcraw]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[exifautotran]]></category>
		<category><![CDATA[gimv]]></category>
		<category><![CDATA[gphoto2]]></category>
		<category><![CDATA[JPG]]></category>
		<category><![CDATA[md5sum]]></category>
		<category><![CDATA[NEF]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/03/13/script-som-henter-bilder-fra-kamera-osv/</guid>
		<description><![CDATA[1. download photos from camera and sort them by date of day in folders 2. remove possible duplicates if I did not erase camera images since last download 3. convert RAW/NEF images to a usable format All this in one single click! #!/bin/bash # Change this to where to store Photos target=/home/multimedia/Images camera=”USB PTP Class [...]]]></description>
			<content:encoded><![CDATA[<p>1. download photos from camera and sort them by date of day in folders<br />
2. remove possible duplicates if I did not erase camera images since last download<br />
3. convert RAW/NEF images to a usable format</p>
<p>All this in one single click!</p>
<pre>
#!/bin/bash
# Change this to where to store Photos
target=/home/multimedia/Images
camera=”USB PTP Class Camera”
date=$(date –iso-8601)
mkdir -p $target/$date/tmp
cd $target/$date/tmp
# Get all photos from camera
gphoto2 –quiet –camera $camera –port usb: -P
# Do not replace photos that were already uploaded this same day
cp -u $target/$date/tmp/* $target/$date
rm -rf $target/$date/tmp
cd $target/$date
# auto-rotate using exif info
exifautotran *.JPG
# If photos were not erased from camera since last upload, remove duplicates
for i in *.{JPG,NEF}; do
for f in $(find $target -name $i ! -samefile $target/$date/$i); do
if md5sum $f | sed -e “s, .*/, ,” | md5sum –check; then
rm -f $i;
fi
done
done
# decode RAW images if not already done ?
# for i in *.NEF; do if [ ! -e $(basename $i .NEF).ppm ]; then dcraw -w $i; fi; done
# Show them!
gimv -d $target/$date</pre>
<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 = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDMvMTMvc2NyaXB0LXRvLWRvd2xvYWQtcGljdHVyZXMtZnJvbS1jYW1lcmEtYW5kLXJlbmFtZS10aGVtLWV0Yy88d3B0Yj5TY3JpcHQgdG8gZG93bmxvYWQgcGljdHVyZXMgZnJvbSBjYW1lcmEgYW5kIHJlbmFtZSB0aGVtIGV0Yzx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/03/13/script-to-dowload-pictures-from-camera-and-rename-them-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
