The source code of version 1.2 is now available

Project Description

PicasaLight is a Silverlight 2 project that gets and displays albums and photos from Picasa Webalbums. It is written in VB.NET and XAML.

How to get started

The source code, an ASP.NET proxy and a test page are available under the "Source Code" tab. Also, don't forget to take a look at the license (the Ms-RL license implies some restrictions!).
There is a running demo available on http://www.wouterdevinck.net/photos.

The author

This application is written by Wouter Devinck, a Belgian Microsoft Student Partner. You can read more about him on his website and blog: http://www.wouterdevinck.net/blog

Architecture

Silverlight can make cross-domain calls. That means that if your Silverlight application is on www.example.com and the webservice you want to call is on another domain (let’s say www.myperfectapi.org) you can use that service from Silverlight. However, the external server needs to allow your domain to use its service (for example by allowing any domain to use it). Silverlight has its own XML-based format to do that, but it also supports the older crossdomain.xml file that Adobe Flash uses. There’s only one limitation: Silverlight will only go looking for this file in the root of the external server. Unlike Flash, you cannot point Silverlight at a specific file in a specific directory.

The Picasa Web Albums Data API has a crossdomain.xml file: http://photos.googleapis.com/data/crossdomain.xml But, as you can see in the link, that file is not in the root. Google has even formally refused to put a cross-domain policy file in the root!

The only workaround for this problem is to build a proxy. That proxy needs to be a page that takes a few parameters, calls the Picasa API and then returns the XML that the API generates. We can then use the power of LINQ to XML within Silverlight to get all the information we need out of that XML. The proxy can be written in virtually any server side language. I have written one in ASP.Net, but I’m looking for someone who wants to write one in PHP. The benefit of ASP.Net is of course that you can use a .Net language (C# or VB), just like in Silverlight. You don’t need to learn another language. The benefit of PHP is that you can find free hosting for it (just make sure to check the TOS ;-)).

This diagram may help making it clear:

architecture.png

Changelog

  • 1.0 (27 nov 2008)
    • Initial release
  • 1.1 (28 nov 2008)
    • Added next and previous buttons
    • Added spinning thing when loading an enlarged photo
  • 1.1.1 (28 nov 2008)
    • Added copyright info and link to the project page
  • 1.2 (2 dec 2008)
    • Proxy on fixed port (50321) to enable local testing. You can now download the project, open it and run it without having to set up a proxy manually.
    • Spinning thing when loading enlarged photos replaced with spinning Picasa logo
    • The Silverlight and Picasa logos are now embedded in the XAP package
    • Added: animation while downloading the thumbnails
    • Redesigned (using templates) the close, next and previous buttons

Screenshot

screenshotv1.1.1.png

Last edited Jan 29, 2009 at 2:47 PM by wdvinck, version 16