<?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>super-cooper &#187; photography</title>
	<atom:link href="http://www.super-cooper.com/archive/tag/photography/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.super-cooper.com</link>
	<description>Python, GIS, and a sprinkling of mindless drivel from Chad Cooper</description>
	<lastBuildDate>Sat, 21 Aug 2010 20:22:37 +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>Uploading photos to Shutterfly via Python</title>
		<link>http://www.super-cooper.com/archive/2008/12/07/uploading-photos-to-shutterfly-via-python/</link>
		<comments>http://www.super-cooper.com/archive/2008/12/07/uploading-photos-to-shutterfly-via-python/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 19:14:23 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.super-cooper.com/?p=63</guid>
		<description><![CDATA[I finally got done sorting my 2008 photos this morning so I can start putting Christmas gifts together with them and needed to upload about 280 pictures to Shutterfly, where I have been getting prints since about 1999. Of course I could do this with their uploader, but that would be quite lame now, wouldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got done sorting my 2008 photos this morning so I can start putting Christmas gifts together with them and needed to upload about 280 pictures to Shutterfly, where I have been getting prints since about 1999. Of course I could do this with their uploader, but that would be <em>quite lame</em> now, wouldn&#8217;t it, considering I <em>could</em> use Python to do it. Using the code below, the <a href="http://pypi.python.org/pypi/IPTCInfo/1.9.2-rc8">IPTCInfo module</a> and Jeremy Slater&#8217;s very cool <a href="http://conduit.sourcearchive.com/documentation/0.3.13.1/shutterfly_8py-source.html">shutterfly module</a> he wrote for the <a href="http://www.conduit-project.org/">GNOME Conduit Project</a> , I can iterate through my entire 2008 photo directory, look for my photos tagged for upload, and upload them to a specific album on Shutterfly. Sweet!</p>
<link rel="stylesheet" href="http://www.super-cooper.com/wp-content/plugins/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code><span style="color: #0008E6;font-weight:bold;">from</span> IPTC <span style="color: #0008E6;font-weight:bold;">import</span> IPTCInfo</code></li>
<li value="2" class="tab0 even"><code><span style="color: #0008E6;font-weight:bold;">import</span> <span style="color: #990000;">sys</span>, <span style="color: #990000;">os</span>, shutterfly</code></li>
<li value="3" class="odd">&nbsp;</li>
<li value="4" class="tab0 even"><code><span style="color: #0008E6;font-weight:bold;">class</span> ShutterflyUploadr:</code></li>
<li value="5" class="odd">&nbsp;</li>
<li value="6" class="tab1 even"><code><span style="color: #990000;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:</code></li>
<li value="7" class="tab2 odd"><code><span style="color: #0008E6;font-weight:bold;">pass</span></code></li>
<li value="8" class="even">&nbsp;</li>
<li value="9" class="tab1 odd"><code><span style="color: #990000;font-weight:bold;">def</span> grab_new_images<span style="color: black;">&#40;</span> <span style="color: #008000;">self</span> <span style="color: black;">&#41;</span>:</code></li>
<li value="10" class="tab2 even"><code><span style="color: #FF6600;">&quot;&quot;&quot; Recurses thru directories and looks for images to upload. I only want to upload my '5-star' images, so we scan the IPTC tags for 'r5', my way of tagging my pics I really like (usually get prints of r5s) &quot;&quot;&quot;</span></code></li>
<li value="11" class="tab2 odd"><code>images = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span></code></li>
<li value="12" class="tab2 even"><code><span style="color: #0008E6;font-weight:bold;">for</span> dirpath, dirnames, filenames <span style="color: #0008E6;font-weight:bold;">in</span> <span style="color: #990000;">os</span>.<span style="color: black;">walk</span><span style="color: black;">&#40;</span><span style="color: #2DB300;">'/users/chad/pictures/2008'</span><span style="color: black;">&#41;</span>:</code></li>
<li value="13" class="tab3 odd"><code><span style="color: #0008E6;font-weight:bold;">for</span> f <span style="color: #0008E6;font-weight:bold;">in</span> filenames :</code></li>
<li value="14" class="tab4 even"><code><span style="color: #FF6600;"># Grab IPTC keywords</span></code></li>
<li value="15" class="tab4 odd"><code>info = IPTCInfo<span style="color: black;">&#40;</span><span style="color: #990000;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>dirpath, f<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></code></li>
<li value="16" class="tab4 even"><code><span style="color: #FF6600;"># Is it a 5-star photo?</span></code></li>
<li value="17" class="tab4 odd"><code><span style="color: #0008E6;font-weight:bold;">if</span> <span style="color: #2DB300;">'r5'</span> <span style="color: #0008E6;font-weight:bold;">in</span> info.<span style="color: black;">keywords</span>:</code></li>
<li value="18" class="tab5 even"><code>ext = f.<span style="color: black;">lower</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>&#038;quot<span style="color: #66cc66;">;</span>.&#038;quot<span style="color: #66cc66;">;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #FF0000; font-weight: bold;">-1</span><span style="color: black;">&#93;</span></code></li>
<li value="19" class="tab5 odd"><code><span style="color: #0008E6;font-weight:bold;">if</span> <span style="color: black;">&#40;</span> ext == &#038;quot<span style="color: #66cc66;">;</span>jpg&#038;quot<span style="color: #66cc66;">;</span> <span style="color: black;">&#41;</span>:</code></li>
<li value="20" class="tab6 even"><code>images.<span style="color: black;">append</span><span style="color: black;">&#40;</span> <span style="color: #990000;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">normpath</span><span style="color: black;">&#40;</span> dirpath + &#038;quot<span style="color: #66cc66;">;</span>/&#038;quot<span style="color: #66cc66;">;</span> + f <span style="color: black;">&#41;</span> <span style="color: black;">&#41;</span></code></li>
<li value="21" class="tab2 odd"><code>images.<span style="color: black;">sort</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></code></li>
<li value="22" class="tab2 even"><code><span style="color: #0008E6;font-weight:bold;">return</span> images</code></li>
<li value="23" class="odd">&nbsp;</li>
<li value="24" class="tab1 even"><code><span style="color: #990000;font-weight:bold;">def</span> upload<span style="color: black;">&#40;</span> <span style="color: #008000;">self</span> <span style="color: black;">&#41;</span>:</code></li>
<li value="25" class="tab2 odd"><code><span style="color: #FF6600;">&quot;&quot;&quot; Upload images to Shutterfly &quot;&quot;&quot;</span></code></li>
<li value="26" class="tab2 even"><code><span style="color: #990000;">user</span> = <span style="color: #2DB300;">'your_user_name'</span></code></li>
<li value="27" class="tab2 odd"><code><span style="color: #990000;">pwd</span> = <span style="color: #2DB300;">'your_password'</span></code></li>
<li value="28" class="tab2 even"><code>sfly = shutterfly.<span style="color: black;">Shutterfly</span><span style="color: black;">&#40;</span><span style="color: #990000;">user</span>,<span style="color: #990000;">pwd</span><span style="color: black;">&#41;</span></code></li>
<li value="29" class="tab2 odd"><code><span style="color: #FF6600;"># Get an existing album</span></code></li>
<li value="30" class="tab2 even"><code>album = sfly.<span style="color: black;">getAlbums</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #2DB300;">'Album_Name'</span><span style="color: black;">&#93;</span></code></li>
<li value="31" class="tab2 odd"><code>image_list = <span style="color: #008000;">self</span>.<span style="color: black;">grab_new_images</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></code></li>
<li value="32" class="tab2 even"><code><span style="color: #0008E6;font-weight:bold;">for</span> image <span style="color: #0008E6;font-weight:bold;">in</span> image_list:</code></li>
<li value="33" class="tab3 odd"><code>album.<span style="color: black;">uploadPhoto</span><span style="color: black;">&#40;</span>image, <span style="color: #2DB300;">'image/jpeg'</span>, <span style="color: #990000;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">basename</span><span style="color: black;">&#40;</span>image<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></code></li>
<li value="34" class="even">&nbsp;</li>
<li value="35" class="tab0 odd"><code><span style="color: #0008E6;font-weight:bold;">if</span> __name__ == <span style="color: #2DB300;">'__main__'</span>:</code></li>
<li value="36" class="even">&nbsp;</li>
<li value="37" class="tab1 odd"><code>sfu = ShutterflyUploadr<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></code></li>
<li value="38" class="tab1 even"><code>sfu.<span style="color: black;">upload</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.super-cooper.com/snippets/shutterflyuploadr.txt">shutterflyuploadr.txt</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.super-cooper.com/archive/2008/12/07/uploading-photos-to-shutterfly-via-python/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>flickruploadr.py now in svn</title>
		<link>http://www.super-cooper.com/archive/2008/08/09/flickruploadrpy-now-in-svn/</link>
		<comments>http://www.super-cooper.com/archive/2008/08/09/flickruploadrpy-now-in-svn/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 04:48:45 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.super-cooper.com/archive/2008/08/09/flickruploadrpy-now-in-svn/</guid>
		<description><![CDATA[I finally got around to getting a Subversion repository setup, so the latest development version of my flickuploadr.py can be checked out: svn co http://svn.super-cooper.com/flickruploadr/trunk or you can just get it at: http://svn.super-cooper.com/flickruploadr/trunk]]></description>
			<content:encoded><![CDATA[<p>I finally got around to getting a Subversion repository setup, so the latest development version of my flickuploadr.py can be checked out:</p>
<p><code>svn co http://svn.super-cooper.com/flickruploadr/trunk</code></p>
<p>or you can just get it at:</p>
<p><a href="http://svn.super-cooper.com/flickruploadr/trunk">http://svn.super-cooper.com/flickruploadr/trunk</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.super-cooper.com/archive/2008/08/09/flickruploadrpy-now-in-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New toy</title>
		<link>http://www.super-cooper.com/archive/2004/07/12/new-toy/</link>
		<comments>http://www.super-cooper.com/archive/2004/07/12/new-toy/#comments</comments>
		<pubDate>Tue, 13 Jul 2004 03:59:03 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://super-cooper.com/?p=29</guid>
		<description><![CDATA[So I broke down and got a new toy the other day. We needed a camera to get pics of the youngin&#8217;, and my old digital wasn&#8217;t cuttin&#8217; it anymore. I was kickin&#8217; it old-school, big time. So the decision had to be made &#8212; film or digital?? I wanted an SLR for the features, [...]]]></description>
			<content:encoded><![CDATA[<p>So I broke down and got a <a href="http://www.nikonusa.com/template.php?cat=1&amp;grp=6&amp;productNr=1722">new toy</a> the other day. We needed a camera to get pics of the youngin&#8217;, and my <a href="http://www.imaging-resource.com/PRODS/D450/D450A.HTM">old digital</a> wasn&#8217;t cuttin&#8217; it anymore. I was kickin&#8217; it old-school, big time. So the decision had to be made &#8212; film or digital?? I wanted an SLR for the features, but couldn&#8217;t really afford the <a href="http://www.nikonusa.com/template.php?cat=1&amp;grp=2&amp;productNr=25214">one</a> I wanted. And my other reason for not going digital SLR is that the prices of digital SLRs will keep going down while the technology only gets better, just as the case has always been with digital cameras. Hell, five years ago, I paid $500 for the Olympus D-450 Zoom. That camera would coast about $150 now. Also, I found that with my digital point and shoot, I had tons of pics that were just crap. Crap, really. Now, with the 35 mm, I feel that I take more time and put more thought into composing my shots. Maybe I know in the back of my head that I can&#8217;t afford to process three rolls a week either, huh? At any rate, the Nikon N75 is really nice so far. However, I am a novice, so my opinion might not really be worth that much. Shots to come soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.super-cooper.com/archive/2004/07/12/new-toy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
