Picasa Web Albums is one of many websites for hosting photos online and making web galleries. I for one like the site a lot; I'm not quite a fan of Flickr, for instance.
Up until quite recently, users of operating systems other than Windows or Mac OS X had a problem though – no tools were available for batch uploading. A couple of pictures are not a big deal, one can just upload them via web form, but if you have more than a dozen, clicking becomes very cumbersome. The Picasa client for Linux, available since June 2006 (works under WINE) does not support Picasa Web. Fortunately, Google following the tradition of open standards, recently published the API for Picasa Web Albums.
Update: 2007-06-25.
An open API makes it possible to write tools for any platform and programming language. The first known implementation for Linux was the GNOME picture viewer F-Spot. For those who like GUI apps and have nothing against Mono, F-Spot is probably the best choice at the moment.
I, on the other hand, was not keen to install F-Spot, because it would also pull a lot of dependencies:
Depends: libart-2.0-2 (>= 2.3.16), libatk1.0-0 (>= 1.13.1), libbonobo2-0 (>= 2.15.0), libbonoboui2-0 (>= 2.15.1), libc6 (>= 2.5-0ubuntu1), libcairo2 (>= 1.4.2), libexif12, libfontconfig1 (>= 2.4.0), libgconf2-4 (>= 2.13.5), libglib2.0-0 (>= 2.12.9), libgnome-keyring0 (>= 0.7.1), libgnome2-0 (>= 2.14.1), libgnomecanvas2-0 (>= 2.11.1), libgnomeui-0 (>= 2.17.1), libgnomevfs2-0 (>= 1:2.17.90), libgtk2.0-0 (>= 2.10.3), libice6 (>= 1:1.0.0), libjpeg62, liblcms1 (>= 1.08-1), libmono0 (>= 1.2.3), liborbit2 (>= 1:2.14.1), libpango1.0-0 (>= 1.16.1), libpopt0 (>= 1.10), libsm6, libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxfixes3 (>= 1:4.0.1), libxi6, libxinerama1, libxrandr2 (>= 2:1.2.0), libxrender1, mono-runtime (>= 1.1.8.1), libc6 (>= 2.5-0ubuntu1) | libc6.1 (>= 2.5-0ubuntu1), libgconf2.0-cil (>= 2.15.0), libgl1-mesa-glx | libgl1, libglade2.0-cil (>= 2.9.0), libglib2.0-cil (>= 2.9.0), libgnome2.0-cil (>= 2.15.0), libgphoto2-2 (>= 2.3.0), libgphoto2-port0 (>= 2.3.0), libgtk2.0-cil (>= 2.9.0), libmono-corlib2.0-cil (>= 1.2.3), libmono-sharpzip2.84-cil (>= 1.0), libmono-sqlite2.0-cil (>= 1.0), libmono-system-data2.0-cil (>= 1.0), libmono-system-web2.0-cil (>= 1.0), libmono-system2.0-cil (>= 1.2.3), libmono2.0-cil (>= 1.2.3), libndesk-dbus-glib1.0-cil (>= 0.3), libndesk-dbus1.0-cil (>= 0.4)
I just didn't want to lose space for Mono environment, which would be used by this one and only program. Besides, .NET is evil :-)
I was looking for something small, working from command line. It turns out that several gdata API libraries are being developed in various languages, e.g. the Python implementation. Using this library we can quickly reach our target. But first, we need to write a simple script to use it, because the library as is doesn't contain user tools, but programmatic interfaces only.
I used a script by Jeff Scudder from Google as the base. It is included in the distribution as a unit test. I added a couple of lines to support command line parameters, made some cosmetic changes and here you are: picasa_upload.py. I'm not an expert in Python, so the script is not foolproof, but it should work.
Before you can use the script, you have install the gdata-python-client
library. It has several dependencies: ElementTree, httplib, urllib modules.
In Ubuntu all of them happen to be a part of standard python2.5
package, but in other distributions you might have to install additional
packages. Next, unpack the gdata tarball and run:
./setup.py install --prefix=/usr/local
If all goes well, my script should now work correctly. Just change the
variables username and password in the script
accordingly and start testing. For example, here's how you can upload all
JPEGs from the current directory to the album named “My_photos”.
$ ./picasa_upload.py My_photos *.jpg
Update (2007-06-25):
Ulrik Stervbo proposed some
changes in the script, among others support for recursive file upload and
better code structure. So I have replaced the version and you are welcome to
download the new script again.
Additionally, some alternative projects appeared in the meantime. For the sake of completeness let me list all the tools, which help to manage your Google Picasa Web Albums from Linux (or other Unix-like operating systems, e.g. FreeBSD, Solaris, Mac OS X):
- picasa_upload.py – my simple script,
- F-Spot – graphical photo manager, requires Mono runtime,
- Firefox Universal Uploader (fireuploader) – Firefox plugin, according to a test by one reader of this blog it should work with a proxy, as opposed to other programs,
- upload2picasa – a more advanced script in Python, like mine based on GData library, author: Artyom 'logus' Pervukhin,
- PicasaUploader – a graphical uploader in Python using GData and PyGTK libraries, author: Walker,
- digikam_picasa.py – a script working with the digiKam database, author: Svilen Ivanov,
- Picasaput – a Java program using GData library, author: xacid(?).
P.S. And Flickr sucks, because:
- the website is quite slow for me,
- the default picture size is too small,
- the slideshow requires Flash.

