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.
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:
sudo apt-get install libxml-simple-perl
sudo wget -O /usr/local/bin/picasa-export http://blog.philippheckel.com/uploads/2011/01/picasa-export
sudo chmod +x /usr/local/bin/picasa-export
That’s it for the installation.
Download: Picasa Export 0.1, January 2011
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”:
- Picasa: Click “Folder” → “Export to HTML Page…”. Select “XML Code” in the template list. Click “Export”.
Shell1picasa-export ~/"Picasa HTML Exports/YourAlbum"
After that, the new folder “neworder” contains the renamed pictures.
Good stuff! Thanks for making it public!
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.
interesting. Can you share the new script? On Pastebin or so?