<?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>notes from Ken &#187; Singleshot</title>
	<atom:link href="http://www.notes.xythian.net/category/programming/singleshot/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.notes.xythian.net</link>
	<description>Links, technical notes, whatnot.</description>
	<lastBuildDate>Sun, 04 Jul 2010 19:01:15 +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>Singleshot and Git and first steps</title>
		<link>http://www.notes.xythian.net/2009/03/04/singleshot-and-git-and-first-steps/</link>
		<comments>http://www.notes.xythian.net/2009/03/04/singleshot-and-git-and-first-steps/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 08:12:18 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Experience]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/?p=240</guid>
		<description><![CDATA[Singleshot is the photo album software I use to host photos.xythian.com. The last release was .. rather a while ago though I have been making minor enhancements and bug fixes since then for my own use (including flash video support which extracts thumbnails using mplayer and embeds flowplayer to play) though there&#8217;s no video on [...]]]></description>
			<content:encoded><![CDATA[<p>Singleshot is the photo album software I use to host <a href="http://photos.xythian.com/">photos.xythian.com</a>.  The last release was .. rather a while ago though I have been making minor enhancements and bug fixes since then for my own use (including flash video support which extracts thumbnails using mplayer and embeds flowplayer to play) though there&#8217;s no video on my public photo site).</p>
<p>Prior to today every time I took the time to try and update the source tree on Sourceforge I ran into a snag such as &#8220;Sourceforge CVS is unavailable.&#8221;   Months ago, when I tried to migrate from CVS to SVN on Sourceforge I ran into errors.  I didn&#8217;t even try to investigate what went awry as I was low on patience and time.</p>
<p>As a result, my own tree (first in Perforce and now in Subversion) has gotten pretty out of sync from that tree.  I decided to try GitHub and try using Git for something &#8220;real&#8221; &#8212; so I&#8217;m going to move Singleshot&#8217;s source to GitHub and then push all my changes to there.</p>
<p>I followed (mostly) the steps from <a href="http://stackoverflow.com/questions/584522/how-to-export-revision-history-from-mercurial-or-git-to-cvs/584567">How to export revision history from mercurial or git to cvs</a> which describes how to use the git cvsimport command to pull Singleshot&#8217;s revision history from its Sourceforge CVS repository, testing making a tiny change to a README, and pushing that change back to the Sourceforge CVS tree.</p>
<p>(After backing up the source tree on Sourceforge using rsync.)</p>
<pre>
% export CVS_RSH=ssh
% git cvsimport -d :ext:xythian@singleshot.cvs.sourceforge.net:/cvsroot/singleshot -C test1 \
    -r cvs -k -A /home/fox/src/singleshot-import/authors.txt  singleshot
Initialized empty Git repository in /home/fox/src/singleshot-import/test1/.git/
[longish pause]
Counting objects: 561, done.
Compressing objects: 100% (502/502), done.
Writing objects: 100% (561/561), done.
Total 561 (delta 317), reused 0 (delta 0)
</pre>
<p>(Some poking around to see if things look reasonable, making a small change to the README, commiting it first to the git repository and then back to Sourceforge using git cvsexportcommit.)</p>
<p>Then I pushed the whole thing to a GitHub tree:</p>
<p>http://github.com/xythian/singleshot/tree/master</p>
<pre>
% git remote add origin git@github.com:xythian/singleshot.git
% git push origin master
</pre>
<p>That was pretty straightforward and appears to have worked.</p>
<p>My plan is to merge my changes into the out of date tree and then push the new code to GitHub.  If it all works out I&#8217;ll probably indicate that the Sourceforge project is defunct there and host the code on GitHub henceforth. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2009/03/04/singleshot-and-git-and-first-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOn markers and Singleshot</title>
		<link>http://www.notes.xythian.net/2007/03/14/son-markers-and-singleshot/</link>
		<comments>http://www.notes.xythian.net/2007/03/14/son-markers-and-singleshot/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 07:41:47 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2007/03/14/son-markers-and-singleshot/</guid>
		<description><![CDATA[I posted a photo to photos.xythian.com. It didn&#8217;t work. Some digging indicated that Singleshot&#8217;s JPEG height/width detection was failing on the new JPEG. Singleshot&#8217;s JPEG header parsing code was only looking for a SOF0 marker and thus didn&#8217;t work on progressive JPEGs (which used SOF2). This is why it&#8217;s important to read the spec for [...]]]></description>
			<content:encoded><![CDATA[<p>I posted a photo to photos.xythian.com.</p>
<p>It didn&#8217;t work.   Some digging indicated that Singleshot&#8217;s JPEG height/width detection was failing on the new JPEG.</p>
<p>Singleshot&#8217;s JPEG header parsing code was only looking for a SOF0 marker and thus didn&#8217;t work on progressive JPEGs (which used SOF2).   This is why it&#8217;s important to read the spec for file formats you&#8217;re reading rather than just cribbing information like &#8220;to get the height/width from a JPEG, look for the marker 0xC0 and then pull height and width from that block&#8221; from random code</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2007/03/14/son-markers-and-singleshot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>photos.xythian.com and Singleshot</title>
		<link>http://www.notes.xythian.net/2005/10/23/photosxythiancom-and-singleshot/</link>
		<comments>http://www.notes.xythian.net/2005/10/23/photosxythiancom-and-singleshot/#comments</comments>
		<pubDate>Mon, 24 Oct 2005 07:01:00 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2005/10/23/photosxythiancom-and-singleshot/</guid>
		<description><![CDATA[I moved my photo site back to a machine I control directly. It&#8217;s probably not going to stay there, but it does free me from debugging everything twice when I want to add features. Since the last Singleshot release I&#8217;ve fixed a bunch of bugs in IPTC parsing (and added a fallback to use XMP [...]]]></description>
			<content:encoded><![CDATA[<p>I moved <a href="http://photos.xythian.com">my photo site</a> back to a machine I control directly.   It&#8217;s probably not going to stay there, but it does free me from debugging everything twice when I want to add features.</p>
<p>Since the last Singleshot release I&#8217;ve fixed a bunch of bugs in IPTC parsing (and added a fallback to use XMP if IPTC is not there and XMP is).     I&#8217;ve also greatly enhanced the robustness of my tests for  the IPTC reading code with a script that automatically compares the output of Singleshot&#8217;s reader to a couple of other parsers (exiv2, PIL) and alerts me when they differ.   As usual the reality of what shows up in files (even just ones I have) seems to differ from the cold, formal world of a spec. </p>
<p>I&#8217;ve also added a couple a feature of dubious merit: for runs of photos tagged with an event:foo keyword, Singleshot&#8217;s RSS feed and front page treats them as a single post with a link to an album /album/events/foo.   I did it so I could post lots of photos for a party without having them all show up individually in the RSS feed &#8212; it really didn&#8217;t make sense to have that.     I may still have to refine how it works, though.  I&#8217;m not thrilled with the magic dependence on an Album, but I wanted it for this because I wanted to link to a page with some description of the event.</p>
<p>I&#8217;ve also added some pretty experimental  support to allow commenting on individual photos.   It pretty gratutiously uses AJAX-y refreshing because I wanted to play with that.   It appears to work in all the modern browses I have access to (Firefox, IE 6).    If you disable JavaScript, then the comments and the UI for submitting them just don&#8217;t appear.</p>
<p>On the back-end, it stores all the comments in a SQLite &#8220;database&#8221; &#8212; mostly preserving the &#8216;file system is the true source of information&#8217; property of Singleshot. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/10/23/photosxythiancom-and-singleshot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awful patches</title>
		<link>http://www.notes.xythian.net/2005/10/18/awful-patches/</link>
		<comments>http://www.notes.xythian.net/2005/10/18/awful-patches/#comments</comments>
		<pubDate>Tue, 18 Oct 2005 08:07:50 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Experience]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2005/10/18/awful-patches/</guid>
		<description><![CDATA[Also, apparently something else is also behaving differently on NearlyFreeSpeech, breaking the ImageMagick processor. I compensated with an awful hack and, just to be sure, pregenerating all of the view images so I can go to bed without, hopefully, leaving photos.xythian.com woefully broken. I think NearlyFreeSpeech is going to have to go. They seem fine [...]]]></description>
			<content:encoded><![CDATA[<p>Also, apparently something else is also behaving differently on NearlyFreeSpeech, breaking the ImageMagick processor.</p>
<p>I compensated with an awful hack and, just to be sure, pregenerating all of the view images so I can go to bed without, hopefully, leaving photos.xythian.com woefully broken.</p>
<p>I think NearlyFreeSpeech is going to have to go.    They seem fine for relatively static web sites, but trying to run applications there is like tearing my hair out.    Testing on my home machine is <b>completely irrelevant</b> for determining if it&#8217;s  going to work at all on NearlyFreeSpeech.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/10/18/awful-patches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fascinating discoveries</title>
		<link>http://www.notes.xythian.net/2005/10/17/fascinating-discoveries/</link>
		<comments>http://www.notes.xythian.net/2005/10/17/fascinating-discoveries/#comments</comments>
		<pubDate>Tue, 18 Oct 2005 07:51:05 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2005/10/17/fascinating-discoveries/</guid>
		<description><![CDATA[A fascinating discovery, a while after I launched my shiny new site about which I was very proud: mmap is all well and good on Linux on my home machine and on Dreamhost, but apparently doesn&#8217;t work on NearlyFreeSpeech. This .. is problematic for photos.xythian.com.]]></description>
			<content:encoded><![CDATA[<p>A fascinating discovery, a while after I launched my shiny new site about which I was very proud: mmap is all well and good on Linux on my home machine and on Dreamhost, but <b>apparently</b> doesn&#8217;t work on NearlyFreeSpeech.   This .. is problematic for photos.xythian.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/10/17/fascinating-discoveries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Housekeeping</title>
		<link>http://www.notes.xythian.net/2005/10/17/housekeeping/</link>
		<comments>http://www.notes.xythian.net/2005/10/17/housekeeping/#comments</comments>
		<pubDate>Tue, 18 Oct 2005 06:13:11 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/?p=119</guid>
		<description><![CDATA[Singleshot 2.0.1, featuring: Add ~ expansion to singleshotinit.py &#8211;root Fix situation when rewritebase is / Fix RSS feed (publish_time is now a datetime always); RSS feed now works&#8230; Modify month_dir so it creates datetimes at midnight rather than dates &#8212; dates can&#8217;t be sorted with datetimes. Change limits on recent images to take advantage of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://sourceforge.net/project/showfiles.php?group_id=98598&#038;package_id=105653&#038;release_id=364238">Singleshot 2.0.1</a>, featuring:</p>
<blockquote>
<ul>
<li>Add ~ expansion to singleshotinit.py &#8211;root</li>
<li>Fix situation when rewritebase is /</li>
<li>Fix RSS feed (publish_time is now a datetime always); RSS feed now works&#8230;</li>
<li>Modify month_dir so it creates datetimes at midnight rather than dates &#8212; dates can&#8217;t be sorted with datetimes.</li>
<li>Change limits on recent images to take advantage of pagination.</li>
<li>Fix handling in IPTC parsing to deal with more weirdo cases.</li>
<li>Add a way to set page size and modified keywords template to use it.</li>
<li>Fixed conditional display of keywords: label in view when there&#8217;s no keywords.</li>
</ul>
</blockquote>
<p>.. is now released.   I also finally updated <a href="http://photos.xythian.com/">photos.xythian.com</a> with the latest Singleshot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/10/17/housekeeping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Singleshot 2.0.0a3</title>
		<link>http://www.notes.xythian.net/2005/09/20/singleshot-200a3/</link>
		<comments>http://www.notes.xythian.net/2005/09/20/singleshot-200a3/#comments</comments>
		<pubDate>Wed, 21 Sep 2005 02:29:50 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2005/09/20/singleshot-200a3/</guid>
		<description><![CDATA[I slowly creep towards a &#8216;final&#8217; 2.0.0 release. It&#8217;s mostly bug fixes now based on reports from my legions of dedicated testers. In a3, the caching problem when in persistent mode is fixed. Also an issue with Apache 2 and I added pagination of the album pages to sidestep a problem when Singleshot is pointed [...]]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://sourceforge.net/project/showfiles.php?group_id=98598&#038;package_id=105653&#038;release_id=357991">slowly creep</a> towards a &#8216;final&#8217; 2.0.0 release.</p>
<p>It&#8217;s mostly bug fixes now based on reports from my legions of dedicated testers.   In a3, the caching problem when in persistent mode is fixed.   Also an issue with Apache 2 and I added pagination of the album pages to sidestep a problem when Singleshot is pointed at a huge directory of images (1000+).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/09/20/singleshot-200a3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Singleshot FastCGI, other development</title>
		<link>http://www.notes.xythian.net/2005/09/11/singleshot-fastcgi-other-development/</link>
		<comments>http://www.notes.xythian.net/2005/09/11/singleshot-fastcgi-other-development/#comments</comments>
		<pubDate>Mon, 12 Sep 2005 02:04:16 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2005/09/11/singleshot-fastcgi-other-development/</guid>
		<description><![CDATA[Encouraged by how fast Singleshot is when running as a persistant process but discouraged by the relatively scarcity of mod_python hosting, I wrote a FastCGI wrapper for Singleshot this weekend. It may be faster than the mod_python version. I feel better about it than the mod_python version, because I know exactly how many instances will [...]]]></description>
			<content:encoded><![CDATA[<p>Encouraged by how fast Singleshot is when running as a persistant process but discouraged by the relatively scarcity of mod_python hosting, I wrote a FastCGI wrapper for Singleshot this weekend.  It may be faster than the mod_python version.   I feel better about it than the mod_python version, because I know exactly how many instances will get started (vs one per Apache process) and it runs out of process from apache (which means it won&#8217;t get horked by Apache2 or anything else Apache is doing).  It can also in theory interface with other FastCGI aware webservers, though I haven&#8217;t tested that.</p>
<p>It&#8217;ll be in Singleshot 2.0, though at least as experimentally as the mod_python support.   My plan is to include both mod_python and FastCGI support with the 2.0 release and see if anyone other than me cares about it.   I&#8217;ll be using the FastCGI support for photos.xythian.com as soon as I move it somewhere that supports FastCGI (probably Dreamhost since I already have things there but I may try TextDrive).   TextDrive is appealing because it&#8217;ll let me easily host just photos.xythian.com with them without delegating xythian.com&#8217;s DNS to them.   ISPs that think a domain is just a web site can be pretty irritating.</p>
<p>FastCGI Singleshot currently only supports ImageMagick for image resizing &#8212; it&#8217;s single threaded and it turned out having the whole process block for making thumbnails was not good for responsivness.    Since Singleshot already spawned a process to run convert, it was easy enough to have it not block the main thread on the spawned converts.   Since ImageMagick was also faster and still seems to have a quality edge over PIL, it was an easy decision to only support ImageMagick when deployed using FastCGI.</p>
<p>Singleshot FastCGI supports multiple, multiplexed connections and allows the server to reuse connections.  Too bad Apache mod_fastcgi doesn&#8217;t.   I still need to test the new FastCGI support with another web server, and also figure out how the current reliance on mod_rewrite rules will translate for other webservers.</p>
<p>My FastCGI implementation just depends on asyncore, so no new dependencies were introduced with it.</p>
<p>Aside from the new deploy work, I also fixed lots of little bugs.   I&#8217;ll probably start putting prerelease builds up on Sourceforge soon, as soon as I take the time to write up some preliminary install docs.</p>
<p>Eventually I&#8217;ll probably go ahead and make a deploy option where Singleshot runs as a standalone webserver, because I can.    That will almost certainly depend on Twisted so I can get all the HTTP/1.1 support without having to write it myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/09/11/singleshot-fastcgi-other-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Singleshot performance and other developments</title>
		<link>http://www.notes.xythian.net/2005/09/05/singleshot-performance-and-other-developments/</link>
		<comments>http://www.notes.xythian.net/2005/09/05/singleshot-performance-and-other-developments/#comments</comments>
		<pubDate>Mon, 05 Sep 2005 18:53:17 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2005/09/05/singleshot-performance-and-other-developments/</guid>
		<description><![CDATA[I was dismayed by how slow parsing all that XMP was in Singleshot when all I really wanted out of it was the keywords that the PIL IPTC parsing was failing to get right. So I dug up the IPTC spec and wrote my own parser. Now not only is it much faster (since I [...]]]></description>
			<content:encoded><![CDATA[<p>I was dismayed by how slow parsing all that XMP was in Singleshot when all I really wanted out of it was the keywords that the PIL IPTC parsing was failing to get right.   So I dug up the <a href="http://www.iptc.org/pages/index.php">IPTC spec</a> and wrote my own parser.  Now not only is it much faster (since I don&#8217;t have to parse XMP at all; virtually anything that puts XMP in also puts IPTC data), but now Singleshot doesn&#8217;t depend on PIL to get IPTC headlines, keywords, etc.</p>
<p>Singleshot was still dependent on PIL for EXIF data.   In Singleshot 1.0 I used EXIF.py, but EXIF.py was so slow that for 2.0 I made Singleshot use PIL&#8217;s exif parser if it was available.   I profiled EXIF.py and tweaked a couple things to get some more speed (around 25%), but it still wasn&#8217;t enough.   One of the reasons EXIF.py was slow is it was gathering much more data than I actually cared about &#8212; it was even decoding the JPEG thumbnails in the EXIF data.</p>
<p>So, using both EXIF.py and <a href="http://www.exif.org/Exif2-2.PDF">the EXIF 2.2 spec</a>, I wrote my own EXIF parser that pulled out the tags I wanted. </p>
<p>Before doing this, pulling all the metadata out of my tree of test images took around 9 seconds with EXIF.py and 4 seconds with PIL&#8217;s EXIF parsing.    Now it takes 0.6 seconds.</p>
<p>I also finally finished the work to enable more image types, adding PNG and GIF as supported image types when Singleshot is using PIL.  I need to dig up how to get the size out of PNG and GIF from the file header before  I can add PNG and GIF to the ImageMagick processor &#8212; I don&#8217;t want to have to fork off a process just to get image height and width.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/09/05/singleshot-performance-and-other-developments/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Oops and more development.</title>
		<link>http://www.notes.xythian.net/2005/09/02/oops-and-more-development/</link>
		<comments>http://www.notes.xythian.net/2005/09/02/oops-and-more-development/#comments</comments>
		<pubDate>Fri, 02 Sep 2005 08:33:15 +0000</pubDate>
		<dc:creator>Ken</dc:creator>
				<category><![CDATA[Singleshot]]></category>

		<guid isPermaLink="false">http://www.notes.xythian.net/2005/09/02/oops-and-more-development/</guid>
		<description><![CDATA[I noticed the URLs in the photos.xythian.com RSS feed were broken (http// is not http://). Fixed, but changing the Guids on posts may confuse some RSS readers into thinking they&#8217;re all new posts. Oops. I&#8217;ve been finishing up the rearranging of the Singleshot files and preparing to package it with some instructions for a release. [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed the URLs in the photos.xythian.com RSS feed were broken (http// is not http://).  Fixed, but changing the Guids on posts may confuse some RSS readers into thinking they&#8217;re all new posts.   Oops.</p>
<p>I&#8217;ve been finishing up the rearranging of the Singleshot files and preparing to package it with some instructions for a release.</p>
<p>I took a few hours to experiment with running Singleshot under mod_python, though, to see how easy it would be.   My proof-of-concept is clearly prototype-grade, but it was encouraging: Singleshot is really, really snappy when it&#8217;s not saddled with the overhead of CGI.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notes.xythian.net/2005/09/02/oops-and-more-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
