Friday, 10 April 2009

Moving to Flickr

Image representing Flickr as depicted in Crunc...Image via CrunchBase

All the voucher pictures in our NSG database take up to 2.5GB in hard disk space, which is quite a lot for 3300 pictures only.

This is indeed a problem if we decide to move the database into a private, commercial server because buying 2.5 GB of space can be quite expensive.

Then Flickr might be able to help. By having a PRO account, users are allowed to upload unlimited number of photos and even retaining the original sizes of high resolution photos, for only 25 USD per year. Quite a bargain indeed.

Since moving more than 3000 pictures can be tiresome, I used used Flickr's API interface and grabbed an API key.

Then I found the PHP class libraries of Phlickr very useful as a layer on top of Flickr's API.

I used Phlickr to harvest information from the NSG database and included it as Title, description and Tags of the photos to be uploaded to Flickr.

Almost everything worked as a charm. However, I found that Phlickr got problems in getting the image URL, by constructing the link using the wrong id of the photo. I had to fix it by hacking the Photo.php class -> function buildImgUrl()

The database then will link to the photo on Flickr:



Now people can comment on every picture and point out whenever we misidentify the vouchers. The possibility of adding notes on top of the photo might of some use.

NSG's photostream in Flickr: http://www.flickr.com/photos/nsg_db/



Reblog this post [with Zemanta]