Turkey Photos

Saturday, September 29th, 2007

All the pictures from Turkey are now on Blakepics, with a selection in the video below.


Alternatively, check here for the full quality version of the Turkey video. The music is “Beautiful Disaster” by John McLaughlin.

Mobile Blakepics with Gallery2, AddViaEmail, Gmail, Symbian and Shozu

Wednesday, September 12th, 2007

12092007013.jpg
The plan was to get photos on Blakepics without the hassle of using computers, web browsers, memory card readers, cables, wires or Royal Mail. The secondary goal of the whole thing is to be a bit cool – so naturally it’s a mash-up of a number of different partially connected services, and I’ll briefly mention Facebook just so that we can check that one off and call it Web 2.0.

So, first step – Gallery2 has an AddViaEmail module. Install that, signup for a Google Mail account and get yourself a really obscure email address. Once you’ve got the AddViaEmail installed and configured (yep, it supports Google’s SSL pop3 servers), you can send emails to that address and have them automagically added to a specific album on your Gallery2 server.

You could stop here if you like – most mobile phones come with email software nowadays. So you can write an email, attach your images, and off they go. But I find email on the little keypads really annoying. And there’s all that typing, clicking, and making sure you get things right to worry about. You’re not exactly cutting edge, with email … are you? Besides, we’ve only made use of three different vaguely related services. That’s not what the web of the future is all about. I’ve heard about it in fairy tales.

So, get yourself a Shozu account. They provide a really cool backup / Share-It service and comes complete with a Symbian application which you can install on your brand new ultra-shiny Nokia N95. For example. If you use this, you can get yourself some single-click access to uploading your photos. Actually, it’s a 3-click minimum. But it’s better than typing email addresses or searching for contacts. They provide a bunch of other ways of sharing your photos, such as uploading to the BBC for consideration as part of their stories. Or more usefully to a WordPress blog or Facebook to humiliate your mates before they’ve got home from the pub and had a chance to de-tag all your new compromising photos.

But alas, AddViaEmail and Shozu don’t play very nicely. So, here are some changes to make to your php script (don’t be scared, it won’t bite).

/modules/addviaemail/classes/AddViaEmailHelper.class – Fix problems with the mime type…
list ($ret, $item) = GalleryCoreApi::addItemToAlbum($pathToSaveFile . $filename,$filename, $filename, $summary, '', $mimeType, $targetDestination);
->
list ($ret, $item) = GalleryCoreApi::addItemToAlbum($pathToSaveFile . $filename,$filename, $filename, $summary, '', 'image/jpeg', $targetDestination);
You’ll also need to disable the subject line spam checker as Shozu will send your email with the subject line as the name of the image.

So just remove this:

$header_info->subject == $subjectToMatch &&

The spam checker is actually quite a cool function, so one of these days I’ll come back an regular expression that. But quite likely, I probably won’t post it here. So work it out for yourself :)

See, and that’s all there is to it. I can now upload loads of photos direct through my phone (as I did with the image at the top of the page), and you could too.

Hacking the Facebook Developer API

Sunday, June 3rd, 2007

It’s been a while since I’ve written very much code just for myself, rather than everyone else. So this weekend I’ve decided to jump onto the Facebook API and learn a little bit more about the Gallery2 API in the process.

Why?

I have thousands of photos on Blakepics, and Facebook comes along and wants me to upload them all over again. Well, sure, I can do that – or, it makes a lot more sense to combine the power of the two systems.

What?

Wanting to keep this initial trial run extremely simple – I’ve gone for just adding a link below my profile picture. That way I can keep very clear of the Gallery API for the time being effectively reducing my problems by half :)

How?

  1. User adds the Blakepics application on Facebook
  2. Setting the Callback URL on Facebook, a request is made to Blakepics.com
  3. Blakepics.com makes use of the Facebook API to check the currently logged in user
    // the facebook client library
    include_once('../modules/facebooktaggedalbums/api/client/facebook.php');
    include_once('../modules/facebooktaggedalbums/api/client/facebookapi_php5_restlib.php');
    // some basic library functions
    include_once('../modules/facebooktaggedalbums/api/lib.php');
    // this defines some of your basic setup
    include_once('../modules/facebooktaggedalbums/api/config.php');
    $facebook = new Facebook($api_key, $secret);
    $facebook->require_frame();
    $user = $facebook->require_login();
  4. Using this user ID, Blakepics requests the first and last name of that user from Facebook
    $user_info = $facebook->api_client->users_getInfo ($user, 'first_name,last_name');
  5. Generate a URL that links to the tagged album, e.g. http://www.blakepics.com/key/kevin+blake. Using the rather cool FBML (FaceBook Markup Language), the link can be sent to Facebook with the instruction that this should be applied as a profile action (fb:profile-action).
    $fbml="<fb:profile-action url=\"http://www.blakepics.com/key/" . $user_info[0]['first_name'] . "+".$user_info[0]['last_name']."\">View more Photos of me at Blakepics</fb:profile-action>";
    $facebook->api_client->profile_setFBML($fbml, $user);
  6. And display a message back to the user, to let them know what’s happened
    print "Blakepics profile link has been added";

And that’s it really. Obviously there’s a lot more that can be done, but the simple application works and is on its way to approval from the Facebook team. All being well, you should be able to add your own links to tagged albums very shortly.

Geo-tagging the universe, one step at a time…

Sunday, October 1st, 2006

I’ve recently brought myself a Track Stick, after Ben pointed them out on thinkgeek.com. Believe it or not, the purpose of this purchase was not to attach it to the underside of a family members car, nor will I be attempting to covertly attach it to employees feet to verify that they’re are just going across the river for some lunch and not in actual fact going for an interview somewhere else.

In fact, it’s far less sinister than all of that, to track my holidays, places I’ve been, and more importantly – the photos I take whilst I’m there. Geotagging, or geocoding has received quite a lot of press lately, since Flickr have introduced it into their service.

I took the Track Stick into London at the weekend, for a trial run before Croatia later this month. The concept is quite simple. The GPS device records your co-ordinates alongside the time and date. The camera records the time and date when you took the photo. Once you’re back home on your PC, you can use these two pieces of information to automatically add co-ordinates into each of your photos’ EXIF headers (metadata). From there, it gets really fun :)

  • View your photos on a map like Google Earth.
  • Search for your photos based on location.
  • Find other photos that were taken in a similar area.
  • Automatically create descriptions of your photos based on how other people describe theirs of the same place.
  • Use all of those photos to construct 3D models of your holiday.

Okay, the technology isn’t all there, yet. But the important thing is to start gathering this data and to certainly make what use of it you can. So, that’s what I’ve done :)

How to tag your photos

  1. You’re going to need a GPX track file, like the one here. The bare minimum you need is the latitude, longitude and date/time. Sadly, my Track Stick won’t output this by default. So I had to create a small script to make one from the CSV format it does supply. If you’re in a similar position, you can download my quick hacked together perl script to create your own. I may improve on this in the future, but for now it works.
  2. Secondly, I used a small application called WMMX Location Stamper.
  3. Click on Photos -> Add Photos, and select all the photos you want to tag.
  4. Click on Tracks -> Add Tracks…, and load the file you’ve created as above (or obtained elsewhere if you’re not using a Track Stick).
  5. Click the Apply Tracks button on the bottom, and you’re done – geotagged photos.

Viewing your photos in Google Earth

Using Picasa2, you can save your photos in a Google Earth file and share your entire journey with your friends and family.

  1. Just load your photos into Picasa2 (File -> Add folder to Picasa)
  2. Select the photos you have just added
  3. Click Tools -> GeoTag -> Export to Google Earth
  4. Select a location, where you want to save your file.

Gallery2 / Blakepics

Finally, all of these photos can tie into Gallery2 (which is what I’ll be doing) using the existing Google Maps Module, or watch this space on Tadek’s blog, for a really promising looking module to view locations on single images.

Useful Resources

I came across a number of other useful little applications out there, which while weren’t directly useful to me – might be very helpful to you, so here they are :)

  • WMMX Location Stamper – Stamp your photos with GPS information. Totally Free.
  • Google Earth – The best way to view your photos afterwards ;)
  • Grazer - Another GPS stamping application
  • GPS Visualizer – A great online tool to sort our your GPX files, and much more.
  • Photo Studio – John Hawkins’ explanation of geotagging with Photo Studio.
  • GPS Babel – Converts your GPS track files between loads of different formats (though wouldn’t play nicely with the track stick – let me know if you have more luck!)
  • Robo Geo – nice tagging tool, but it’s a pay-for software and doesn’t really do the job any better than the rest of them.

Celebri-Kev’s and the new layout

Saturday, September 23rd, 2006

MyHeritage.com have a great piece of kit for bloggers everywhere, the facial recognition software will tell you which celebrity party you’re most likely to be able to blend seamlessly into. Hours of fun… Thanks to the knowledge of this has to go to trippy, because I stole it from her blog :)

In other news… I hope you all like the new full width stretchy-layout. It might not look like much, but it has taken many months of hard work, millions of dollars of investment, and a huge team of dedicated professionals….Oh wait, that was that “other” web site. Anyway, I think you’ll agree it’s nice to finally be out of the out-of-the-box wordpress template that has plagued this site for too long :)