Jan 08 9

Creating a photoblog with WordPress

While I updated shutterclicks to the new layout I switched it over to WordPress from Pixelpost. While Pixelpost wasn't exactly unsuitable for what I wanted, its comment handling and generally very ugly codebase had me going nuts whenever I needed to do any maintenance on the site.

I'm now using a very bare bones install of WordPress with the Yet-Another-PhotoBlog plugin. And SpamKarma for spam filtering (which works much better than Akismet in my experience). I'll probably look into other plugins to use on shutterclicks as well once I get all of the Pixelpost content moved over to WordPress. I used the import script from Shifting Pixel to do the base work.

However, it had problems in importing the images and embedding them in the correct post so I need to do some manual work as well. Which is to the better, since I'd need to fiddle around with the images to get them working with YAPB anyhow.

While YAPB has all of the documentation needed to get it going, it still needs some thought before it is fully functional. Unless of course you let it do all the necessary code injection of the pictures (which I naturally don't). For example, there's no template tag to insert the picture itself without any thumbnailing so you have to use some code for it. The following does the trick well enough:

<img src="<?php echo $post-/>image->uri ?>" width="< ?php echo $post->image->width ?>" height="< ?php echo $post->image->height ?>" />

Also, the EXIF output is quite horrible and needs formatting to be more readable. Well, that's all IMHO ;). But I've never liked to see EXIF data displayed as it is on many websites in the very mathematic way (with lots of precision in the numbers etc). Rather I like to see it similar to the camera display (and how Lightroom shows it). So I wrote the following code to customize the EXIF output:

	if ($exif = ExifUtils::getExifData($post->image)) {
		echo '
<ul class="exif">';
		if (!empty($exif['model'])) {
			echo '
<li>' . $exif['model'] . '</li>
 
 ';
		}
		if (!empty($exif['exposureTime'])) {
			$time = $exif['exposureTime'];
			$i = strpos($time, '(');
			$j = strpos($time, ')', $i);
			$time = substr($time, $i + 1, $j - $i - 1);
   			$t = explode('/', $time, 2);
            if (empty($t[1]))
               	echo "
<li>$time s</li>
 
";
            elseif ($t[1] == 1)
                echo "
<li>$t[0] s</li>
 
";
            else
           		echo '
<li>' . $t[0] . '/' . $t[1] . "&#x00A0;s</li>
 
 ";
		}
		if (!empty($exif['fnumber'])) {
			echo '
<li>' . $exif['fnumber'] . '</li>
 
 ';
		}
		if (!empty($exif['isoEquiv']))
			echo '
<li>ISO&#x00A0;' . $exif['isoEquiv'] . '</li>
 
 ';
		if (!empty($exif['exposureBias'])) {
			$ev = $exif['exposureBias'];
			$i = strpos($ev, '(');
			$j = strpos($ev, ')', $i);
			$ev = substr($ev, $i + 1, $j - $i - 1);
			$ev = explode('/', $ev, 2);
            if ($ev[0] == 0)
	            $ev = '0';
   			elseif ($ev[1] >= 10)
           		$ev = $ev[0]/10 . '/' . $ev[1]/10;
   			else
           		$ev = $ev[0] . '/' . $ev[1];
           	echo "
<li>$ev&#x00A0;EV</li>
 
 ";
		}
		if (!empty($exif['focalLength'])) {
			$mm = $exif['focalLength'];
			$i = strpos($mm, ' ');
			$mm = substr($mm, 0, $i);
			$mm = round($mm, 0);
			echo "
<li>$mm&#x00A0;mm</li>
 
 ";
		}
		if (!empty($exif['flashUsed']))
			echo '
<li>Flash:&#x00A0;' . $exif['flashUsed'] . '</li>
 
';
		echo '</ul>
 
';
	}

That code still needs some work, I'm not satisfied with how the exposure bias is displayed (3/3 when I'd like +1 in those cases). But at least it's a step in the right direction.

Jan 08 9

Randomfire updated

I finally got around to changing the layout of the site. Anna designed the holy trinity layout for all three of my blogs (randomfire, randomfire: shutterclicks, and Satunnaisia leiskahduksia) some time ago. Now two of the three have been switched over to the new layout and the latest version of WordPress.
There’s still some work I [...]

Continue reading Randomfire updated »

Aug 06 3

Dropping RSS support

Now that Bloglines finally supports Atom 1.0 I’ll be dropping RSS (0.9x, 1.0, 2.0) support when I finally get the new layout for randomfire ready. I’ll also change WordPress to output Atom 1.0 instead of Atom 0.3.
If I happen to have a reader whose feedreader doesn’t support Atom 1.0, please let me know and I’ll [...]

Continue reading Dropping RSS support »

Jul 05 22

The Life of Jalo updated

To honour the upcoming first birthday of Jalo we created a new layout for his photoblog. The layout is a shift away from the darker and heavier look and Anna certainly had fun creating the banner at the top. Below are screenshots of the old and new layouts.

In the more geeky [...]

Continue reading The Life of Jalo updated »

Feb 05 14

Jermut v2

Presentin the new design for Anna’s comic on the lives and escapades of Finnish firefighters from a small fire station.

Continue reading Jermut v2 »