My name is Philipp C. Heckel and I write about nerdy things.

Picasa for Linux: Export albums in sort order


Linux, Multimedia, Scripting

Picasa for Linux: Export albums in sort order


As one of the best picture organizers out there, Picasa is (in my opinion) almost complete in terms of features and has a nice look and feel at the same time. Even though Google stopped developing the Linux version after 3.0, it still works perfectly using Wine and a couple of cp-statements.

However, as stated many times by Picasa users and bloggers [1,2,3,…], Picasa’s export function misses a tiny little feature that maintains the sort order of the album when exporting it to a folder. Instead of renaming the pictures to keep them sorted in normal file managers (by name), Picasa just copies the files of an album to one folder and thereby destroys the order. As if that wasn’t enough, Picasa also overwrites duplicates filenames from different source folders.

This missing feature has even led to small standalone projects that fix this issue, e.g. Picasa Independent Album Exporter (PIAE) and Picasa Order Preserver. While both applications do their job, both are a bit heavyweight, and PIAE only works for Windows (and not on Wine).

This post presents a tiny little Perl script that renames pictures of an exported album according to their Picasa sort order.


Contents


1. Download & Installation

The script requires Perl module XML::Simple to be installed. In Debian/Ubuntu, install the package libxml-simple-perl.

Download the script, save it to your preferred location and make it executable:

That’s it for the installation.

Download: Picasa Export 0.1, January 2011

2. Usage

Using the script is also very simple. Simple export the desired album using Picasa’s “Export to HTML Page” function and call the script with the exported folder as parameter.

Example with “YourAlbum”:

  1. Picasa: Click “Folder” → “Export to HTML Page…”. Select “XML Code” in the template list. Click “Export”.
  2. Console:

After that, the new folder “neworder” contains the renamed pictures.

3 Comments


  1. Ed

    Thanks for looking into this missing feature from Picasa. I modified your perl script slightly to (a) start at zero (engineer here), (b) increment by ten, and (c) include the entire original image name.

    I think of indexing offsets into arrays, so (a) is a nod to that (index zero is the first). No particular other reason.

    The idea behind setting an increment of more than one is to allow insertion of additional images into the sequence. For example, I often make “title slides” well after the images were taken. The numerical gap between numbered images allows these to be placed where needed.

    I thought about making the starting value and increment command-line parameters, but figured, while easy to do, I’d probably never use it that way.

    And, finally, (c) is so that an easy reference-by-name can be made to the source image. A side effect is that the extension does not have to then be extracted.

    Thanks again,

    Ed