<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:radioWeblogPost="http://backend.userland.com/radioWeblogPostModule" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:admin="http://webns.net/mvcb/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Andrew Shearer's Drivel</title>
    <link>http://www.shearersoftware.com/personal/weblog/</link>
    <description>Computers, the web, Python, Mac OS X, more</description>
    <dc:language>en-us</dc:language>
    <dc:creator>Andrew Shearer (ashearerw@shearersoftware.com)</dc:creator>
    <dc:rights>Copyright 2003 Andrew Shearer</dc:rights>
<item>
<guid isPermaLink="true">http://www.shearersoftware.com/personal/weblog/2003/10/26/#p1026135223</guid>
<description>&lt;p&gt;It meant getting up at 4:10 in the morning to make the drive from Providence, but yesterday I hiked up Mt. Chocorua in New Hampshire with the &lt;a href="http://amcboston.org/youngmembers/"&gt;Boston AMC Young Members&lt;/a&gt; group. At least half of us brought cameras, leading to many entries in the Photographs of Photographers series. &lt;a href="http://www.shearersoftware.com/personal/pictures/2003/10/25/chocorua-hike/"&gt;105 pictures&lt;/a&gt;.&lt;/p&gt;</description>
<title>Mt. Chocorua Hike</title>
<pubDate>Sun, 26 Oct 2003 13:52:23 -0500</pubDate>
<link>http://www.shearersoftware.com/personal/pictures/2003/10/25/chocorua-hike/</link>
<category>Outdoors</category>
<category>Pictures</category>
<radioWeblogPost:id>1026135223</radioWeblogPost:id>
</item>

<item>
<guid isPermaLink="true">http://www.shearersoftware.com/personal/weblog/2003/10/17/#p1017004631</guid>
<description>&lt;p&gt;My &lt;a href="http://www.shearersoftware.com/software/developers/xmlfilter/"&gt;XMLFilter&lt;/a&gt; package was mentioned in Uche Ogbuji&amp;rsquo;s &lt;a href="http://www.xml.com/pub/a/2003/10/15/py-xml.html"&gt;latest Python XML article&lt;/a&gt; on xml.com:&lt;/p&gt;

&lt;p&gt;&lt;blockquote&gt;&lt;a href="http://www.shearersoftware.com/software/developers/xmlfilter/"&gt;XMLFilter&lt;/a&gt;
  is one of those great examples of a unglamorous but extremely valuable
  program.  Based on its description (and I expect to try it out and
  report on it in this column soon), it is a must-have for anyone building
  SAX programs.  It provides a fallback SAX parser/driver to avoid
  SAXReaderNotAvailable errors that users encounter on some platforms.  It
  also offers a safety net against the XMLGenerator bug that bit me
  earlier in this series.  Its main feature, however, is a framework for
  SAX filters.  See Andrew Shearer's &lt;a href="http://mail.python.org/pipermail/python-announce-list/2003-September/002577.html"&gt;announcement&lt;/a&gt;.&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Thanks, Uche!
&lt;/p&gt;</description>
<title>&amp;ldquo;As Seen On xml.com&amp;rdquo;</title>
<pubDate>Fri, 17 Oct 2003 00:46:31 -0400</pubDate>
<link>http://www.xml.com/pub/a/2003/10/15/py-xml.html</link>
<category>Python</category>
<category>Software</category>
<radioWeblogPost:id>1017004631</radioWeblogPost:id>
</item>

<item>
<guid isPermaLink="true">http://www.shearersoftware.com/personal/weblog/2003/10/17/#p1017003724</guid>
<description>&lt;p&gt;A few days ago, I made changes to my photo album software. Now all current and past &lt;a href="http://www.shearersoftware.com/personal/pictures/"&gt;photo albums&lt;/a&gt; have an optional &amp;ldquo;large&amp;rdquo; size with double the pixel count, preserving more detail for users with large screens.&lt;/p&gt;

&lt;p&gt;(There are also some other minor improvements, such as a photo count for each album, links to the next and previous albums by date, and more links to related sites.)&lt;/p&gt;</description>
<title>Pictures. Now 100% Bigger!</title>
<pubDate>Fri, 17 Oct 2003 00:37:24 -0400</pubDate>
<link>http://www.shearersoftware.com/personal/pictures/</link>
<category>Python</category>
<category>Software</category>
<category>Pictures</category>
<radioWeblogPost:id>1017003724</radioWeblogPost:id>
<dcterms:modified>2003-10-17T00:38:03-04:00</dcterms:modified>
</item>

<item>
<guid isPermaLink="true">http://www.shearersoftware.com/personal/weblog/2003/10/17/#p1017002120</guid>
<description>&lt;p&gt;The reporter&amp;rsquo;s sense of irony in &lt;a href="http://www.philly.com/mld/inquirer/news/nation/7023679.htm"&gt;this news article&lt;/a&gt; pushed it to #1 on &lt;a href="http://www.daypop.com/news/"&gt;Daypop&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;blockquote&gt;Bush told his senior aides Tuesday that he "didn't want to see any stories" quoting unnamed administration officials in the media anymore, and that if he did, there would be consequences, said a senior administration official who asked that his name not be used.&lt;/blockquote&gt;&lt;/p&gt;</description>
<title>A Simple Order</title>
<pubDate>Fri, 17 Oct 2003 00:21:20 -0400</pubDate>
<link>http://www.philly.com/mld/inquirer/news/nation/7023679</link>
<category>Politics</category>
<radioWeblogPost:id>1017002120</radioWeblogPost:id>
<dcterms:modified>2003-10-17T00:54:48-04:00</dcterms:modified>
</item>

<item>
<guid isPermaLink="true">http://www.shearersoftware.com/personal/weblog/2003/10/09/#p1009004920</guid>
<pubDate>Thu, 09 Oct 2003 00:49:20 -0400</pubDate>
<description>&lt;p&gt;Tim Bray is &lt;a href="http://www.tbray.org/ongoing/When/200x/2003/10/06/Photoreduction"&gt;looking for a better way&lt;/a&gt; to post photos to his web site. To judge from the sample photo, his current method doesn't antialias the image, so sharp edges in the original look jagged when reduced in size.&lt;/p&gt;

&lt;p&gt;I went through the same thing with iPhoto, which has an HTML Export feature that is similarly broken&amp;mdash;it doesn&amp;rsquo;t antialias at all. It&amp;rsquo;s a strange limitation, considering that the Mac OS X graphics system has fast, high-quality antialiasing everywhere else, including fonts and Dock icons. It&amp;rsquo;s as if Apple turned off a global switch in iPhoto for better performance when displaying large number of images onscreen, but forgot to turn it back on for HTML exporting, where quality should count for much more.&lt;/p&gt;

&lt;p&gt;In any case, the quality of iPhoto&amp;rsquo;s exports was poor, so I wrote a Python script to handle the export using the Python Imaging Library. (Contact me if you&amp;rsquo;d like the code. So far, I&amp;rsquo;ve publicly released only the general-purpose &lt;a href="http://www.shearersoftware.com/software/developers/plist/"&gt;plist parser&lt;/a&gt; that I wrote to handle the AlbumData.xml file.)&lt;/p&gt;

&lt;p&gt;The script reads the titles and comments assigned in iPhoto, and parses them for category and other tagging information I&amp;rsquo;ve appended to the comments. Then it generates date-based and category-based HTML page hierarchies for all the albums whose names start with "Web-", and generates any thumbnails or medium-sized images that are missing.&lt;/p&gt;

&lt;p&gt;The Python Imaging Library, or PIL, is very easy to install with MacPython 2.3&amp;rsquo;s Package Manager.&lt;/p&gt;

&lt;p&gt;There are some drawbacks, though:&lt;/p&gt;

&lt;p&gt;&lt;ul&gt;
&lt;li&gt;I had to push the JPEG quality setting very high to avoid obvious macro-blocking (squares showing up around detailed areas), and pushing the quality any higher caused PIL to fail by throwing an exception.&lt;/li&gt;
&lt;li&gt;The BICUBIC setting for image reduction didn&amp;rsquo;t appear to work at all. The image ended up non-antialiased, the same as Photoshop's "Nearest Neighbor" setting. Only ANTIALIASED had any effect. This may result in bilinear instead of bicubic interpolation, but the documentation isn&amp;rsquo;t clear.&lt;/li&gt;
&lt;li&gt;The Thumbnail setting produces an image quickly, but they are very low-quality.&lt;/li&gt;
&lt;li&gt;The Progressive setting for JPEGs seemed to cause even more exceptions when trying to save at high quality levels, so I was forced not to use it.&lt;/li&gt;
&lt;li&gt;It&amp;rsquo;s not nearly as fast as Mac OS X&amp;rsquo;s Core Graphics image reduction. But then again, I wouldn&amp;rsquo;t expect it to be.&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;On the positive side, the antialiasing looks good, and PIL can also read embedded EXIF data. Images that I've tagged as deserving more info automatically get the aperture and shutter speed printed on the page.&lt;/p&gt;

&lt;p&gt;The code for actually reducing and saving the image, ignoring the EXIF and album manipulations for now, is as simple as this:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
                if not os.path.exists(newPath):
                    shrunkImage = im.resize(size, resample = PIL.Image.ANTIALIAS)
                    shrunkImage.save(newPath, 'JPEG', quality = 90)
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;You can see samples in my &lt;a href="http://www.shearersoftware.com/personal/pictures/"&gt;Pictures&lt;/a&gt; section. Check out the &lt;a href="http://www.shearersoftware.com/personal/pictures/2003/08/city/"&gt;first batch of Providence photos&lt;/a&gt; for some night examples with shutter speeds and apertures shown, and the &lt;a href="http://www.shearersoftware.com/personal/pictures/2003/09/07/providence-kayaking/"&gt;Providence&lt;/a&gt; and &lt;a href="http://www.shearersoftware.com/personal/pictures/2003/10/05/boston-kayaking/"&gt;Boston&lt;/a&gt; kayaking photos for examples of pictures with lots of edges that would have looked much worse without antialiasing.&lt;/p&gt;

&lt;p&gt;
&lt;/p&gt;</description>
<category>Software</category>
<title>Image Size Reduction for the Web</title>
<radioWeblogPost:id>1009004920</radioWeblogPost:id>
</item>

<item>
<guid isPermaLink="true">http://www.shearersoftware.com/personal/weblog/2003/10/06/#p1006235256</guid>
<description>&lt;p&gt;I nearly went to &lt;a href="http://www.docnotes.net/"&gt;Jacob Reider&lt;/a&gt;&amp;rsquo;s &lt;a href="http://blogs.law.harvard.edu/bloggerCon/discuss/msgReader$356?y=2003&amp;m=9&amp;d=23"&gt;Medicine and Weblogs&lt;/a&gt; session at &lt;a href="http://blogs.law.harvard.edu/bloggercon/"&gt;BloggerCon&lt;/a&gt; yesterday, but the weather was so nice that I went kayaking in Boston instead.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://www.ricka.org/"&gt;RICKA&lt;/a&gt;-organized trip went from Magazine Beach down the Charles River into Boston Harbor, and was a great day&amp;rsquo;s paddle. (...Even though I only had 4 hours of sleep the night before, because of a web server power supply failure that meant rigging up other servers to stand in during the replacement.)&lt;/p&gt;

&lt;p&gt;After eliminating, or just not taking, many pictures due to a lens fogging problem that struck my camera&amp;rsquo;s waterproof case for the first time (meaning that I hadn&amp;rsquo;t thought to bring any defogging solution), I still have &lt;a href="http://www.shearersoftware.com/personal/pictures/2003/10/05/boston-kayaking/"&gt;more than 100 pictures&lt;/a&gt;.
&lt;/p&gt;</description>
<title>Boston Kayaking</title>
<pubDate>Mon, 06 Oct 2003 23:52:56 -0400</pubDate>
<link>http://www.shearersoftware.com/personal/pictures/2003/10/05/boston-kayaking/
I only had 4 hours of sleep the night before (because of a web server power supply failure that meant I had to rig up a lot of temporary redirects to other servers). </link>
<category>Outdoors</category>
<category>Pictures</category>
<radioWeblogPost:id>1006235256</radioWeblogPost:id>
<dcterms:modified>2003-10-07T08:46:49-04:00</dcterms:modified>
</item>

</channel>
</rss>