<?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>Joe's Linux Blog &#187; NIKON</title>
	<atom:link href="http://joseph.freivald.com/linux/tag/nikon/feed/" rel="self" type="application/rss+xml" />
	<link>http://joseph.freivald.com/linux</link>
	<description>Linux Admin tips and tricks</description>
	<lastBuildDate>Sat, 31 Dec 2011 07:36:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Copying Nikon RAW pictures to JPEG</title>
		<link>http://joseph.freivald.com/linux/2009/08/24/copying-nikon-raw-pictures-to-jpeg/</link>
		<comments>http://joseph.freivald.com/linux/2009/08/24/copying-nikon-raw-pictures-to-jpeg/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 21:19:41 +0000</pubDate>
		<dc:creator>jfreivald</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[batch convert]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[JPG]]></category>
		<category><![CDATA[NEF]]></category>
		<category><![CDATA[NIKON]]></category>
		<category><![CDATA[RAW]]></category>

		<guid isPermaLink="false">http://joseph.freivald.com/linux/?p=63</guid>
		<description><![CDATA[My wife loves her Nikon camera.  She also loves Photoshop.  The two go together really well.  She takes pictures in the raw &#8220;NEF&#8221; format, and photoshop works miracles on them.  Unfortunately, for sharing snapshots it&#8217;s always a pain in the butt to get each and every picture that we want to share converted to JPEG [...]]]></description>
			<content:encoded><![CDATA[<p>My wife loves her Nikon camera.  She also loves Photoshop.  The two go together really well.  She takes pictures in the raw &#8220;NEF&#8221; format, and photoshop works miracles on them.  Unfortunately, for sharing snapshots it&#8217;s always a pain in the butt to get each and every picture that we want to share converted to JPEG so that everyone who doesn&#8217;t have photoshop can use them.  Not to mention that even as JPEGs, a 10 megapixel photo is too big to go e-mailing to Aunt Laura on her Dial-Up.</p>
<p>The dichotomy is clear: Quality vs. Portability.</p>
<p>So like everything else that takes for ever and is tedious, I wrote a script.  This one looks in the underlying tree and checks to see if each NEF file has a corresponding JPEG file.  If it doesn&#8217;t, then it creates one using ImageMagick.  If there is one, it ignores the file and moves on to the next one. Now she can have the super-high quality RAW pictures, and I can e-mail them to grandma.  Once again, everyone is happy in Joeland.</p>
<p>In this case we also convert the size of the image to two megapixels, which is plenty for sharing photos, but not great for printing blow-ups.  But that&#8217;s okay, because we still have the original NEF to manipulate if we want to!</p>
<p>On Centos I had to do a &#8216;cpan install autodie&#8217; and &#8216;cpan install IPC::System::Simple&#8217; to get this to compile right.  Autodie is nice because if you hit Ctrl-C to stop the script then it will actually stop instead of continuing on to the next picture.</p>
<p>Here is the script:</p>
<pre>#!/usr/bin/perl

use autodie qw(:all);

@FILES = split(/\n/, `find . | grep "\.NEF\$"`);
foreach $file(@FILES) {
    $rawfile = $file;
    $file =~ s/NEF$/small.JPG/;
    if (-d $file) {
        print "Entering directory $file.\n";
    } elsif (! -f $file) {
        print "\t$rawfile -&gt; $file\n";
        system("convert \"$rawfile\" -normalize -resize \"\@2000000\" \"$file\"");
    } else {
        print "\t$rawfile skipped.  $file already exists.\n";
    }
}

Enjoy!

--JATF</pre>
]]></content:encoded>
			<wfw:commentRss>http://joseph.freivald.com/linux/2009/08/24/copying-nikon-raw-pictures-to-jpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

