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

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.

Tags: , , , ,

2 Comments

  1. Hi there,
    I’m trying for days now to get the module addviaemail working, but unsuccesful.

    I know the scripst checks my mailbox, because the mail are READ after a minute, but doens’t add the pictures to the album.
    I also checked the dev/debug/results page but no info or errors there.

    Any ideas? You can reach my via my email: rudolf@sivo.nl

    Tnx in advance,
    Rudolf.

Leave a Reply?