Friday, 30 November 2007

How to copy Picasa Albums from Windows to Linux installation.

Since long ago Picasa for Windows had a nice feature called Album, which allowed organizing photos logically, rather than chronologically. Thanks to Google developers this feature is now available in Picasa Version 2.7.0 Build 37.3607 for Linux, and I started thinking about recovery my old missed albums, I had created years ago. Below are the steps I made to achieve this goal.

Disclaimer: Picasa is designed to prevent any manual changes in its internal files. Although it should not damage your data and picture files, I would suggest to backup the whole ~/.picasa folder with its sub-folders before you started.

It's assumed that:
1. you have both Picasa for Windows and Linux installed;
2. all your old photos, included in the albums, are presented in Picasa for Linux (they can be moved to Linux partition, but the folder structure should remain the same in general);
3. the goal is to copy Picasa Albums from Windows to Linux without re-creating them manually;
4. we work in Linux and have access to Windows partition with old Picasa files.
5. you know how to use Picasa and other tools involved, so I tell you what to do rather than what key to press.

Abstract

Picasa keeps information about albums in separate files located
in Windows:
[windows_drive]\Documents and Settings\[user_name]\Local Settings\Application Data\Google\Picasa2Albums\25a8e096c46096317ee356c5246889b3

in Linux:
~/.picasa/drive_c/Documents and Settings/[user_name]/Local Settings/Application Data/Google/Picasa2Albums/75adfd2e119b03b77391bf21408baf92

where
[windows_drive] is where Windows was installed, usually C:

[user_name] is user name

~ - is your home folder

25a8e096c46096317ee356c5246889b3 and 75adfd2e119b03b77391bf21408baf92 are folder names, generated by Picasa (on my computer); they will differ on your machine, I will call them [album_folder_name].

Each album is a single XML file, called like 8c5a839b4c1b71cfb65d100652642063.pal, I will call it [album_file.pal].

Next to Picasa2Albums is another folder Picasa2 with lots of sub-folders and files, do not touch them.

I did everything using default Gnome GUI tools, like Nautilus and GEdit, without using terminal and root access.

Some information used in the explanation below was found at:
http://forensicir.blogspot.com/2007/07/picasa.html


Steps

1. Open you favourite file manager (Nautilus) and go to
[windows_drive]/Documents and Settings/[user_name]/Local Settings/Application Data/Google/Picasa2Albums/[album_folder_name]
(I have changed backslashes to slashes as we work in Linux)

2. Select all [album_files.pal] and make Copy (Ctrl+C, for example)

3. Go to /tmp and create a new folder, called, for example, PicasaAlbums, then copy your files into that folder (Ctrl+V).

4. Start Picasa for Linux and create a dummy album, which includes at least one photo, same as in the old album, you are going to move. We need this step, because the location of the same file differs between Windows and Linux, and we have to find this difference.
If you moved your photos, included in the albums, so their relative locations have also changed, you have to include more than one picture from different locations to your dummy album.

5. Close Picasa.

6. Go to
~/.picasa/drive_c/Documents and Settings/[user_name]/Local Settings/Application Data/Google/Picasa2Albums/[album_folder_name]
and double click on the [album_file.pal] you have just created. This should open the file in your default text editor (GEdit in my case).

7. Go to
/tmp/PicasaAlbums
and double click on the [album_file.pal], which should contain the same pictures. It will be open in the text editor as well.

If I created a dummy album with two files in it, it would look like this in Linux:
(I have changed angle brackets to square brackets to prevent interference with HTML)

[picasa2album]
[dbid]75adfd2e119b03b77391bf21408baf92[/dbid]
[albumid]91339fd27a046527764eab636a88273d[/albumid]
[property name="token" type="string" value="]album:91339fd27a046527764eab636a88273d"]
[property name="unread" type="flag" value="0"]
[property name="description" type="string" value=""]
[property name="uid" type="string" value="91339fd27a046527764eab636a88273d"]
[property name="location" type="string" value=""]
[property name="name" type="string" value="Dummy"]
[property name="date" type="real64" value="38997.427211"]
[property name="category" type="num" value="0"]
[files]
[filename]$My Documents\PicasaDocuments\Photography\10-October-2006\07102006\P1020492.JPG[/filename]
[filename]$My Documents\PicasaDocuments\Photography\10-October-2006\07102006\P1020466.JPG[/filename]
[/files]
[/picasa2album]

And the beginning of one of my old album with the same files, as it was in Windows:

[picasa2album]
[dbid]25a8e096c46096317ee356c5246889b3[/dbid]
[albumid]55273da2ae671b7ad3fa26365dc9f5eb[/albumid]
[property name="victorrull_lh" type="num64" value="1949171729"]
[property name="unread" type="flag" value="0"]
[property name="uid" type="string" value="55273da2ae671b7ad3fa26365dc9f5eb"]
[property name="token" type="string" value="]album:55273da2ae671b7ad3fa26365dc9f5eb"]
[property name="name" type="string" value="Horse Riding"]
[property name="location" type="string" value="Helensville, Muriwai Beach"]
[property name="description" type="string" value="Horse riding and Muriwai Beach"]
[property name="date" type="real64" value="38997.427211"]
[property name="category" type="num" value="0"]
[files]
[filename][C]\Data\Photography\Panasonic Lumix DMC-FZ5\10-October-2006\07102006\P1020492.JPG[/filename]
[filename][C]\Data\Photography\Panasonic Lumix DMC-FZ5\10-October-2006\07102006\P1020466.JPG[/filename]
.....

I moved these two files, after I had abandoned Picasa for Windows, but now we can find out the difference:
[C]\Data\Photography\Panasonic Lumix DMC-FZ5\10-October-2006\07102006\P1020492.JPG
$My Documents\PicasaDocuments\Photography\10-October-2006\
07102006\P1020492.JPG

8. Switch to the file in /tmp/PicasaAlbums, and call Replace dialogue. Fill in the following fields:
Search For: [C]\Data\Photography\Panasonic Lumix DMC-FZ5
Replace With: $My Documents\PicasaDocuments\Photography
(change the above samples to your real models)
and click Replace All.

9. Make sure everything has changed properly. Save the file. Repeat two last steps, if you need more changes.

10. Copy the SINGLE [album_file.pal] you have just edited from /tmp/PicasaAlbums to

~/.picasa/drive_c/Documents and Settings/[user_name]/Local Settings/Application Data/Google/Picasa2Albums/[album_folder_name]

Important Notice: As I have already mentioned Picasa prevents modification of its internal files. The folder Picasa2 contains a lot of binary files, which keep information about existing albums, including their Hash-sums. But there is a weakness in this protection - if one adds a single album file to the folder, Picasa will accept it. If one adds two or more files at once, or tries to edit existing album file, Picasa will not allow this. Usually it just removes those files, but I am afraid there can be more serious consequences. Also do not try to manipulate with these files while Picasa is running, I neither did it myself nor want you were the first victim of this.

11. Launch Picasa and make sure the new album has appeared in the Albums section.

12. Close Picasa and repeat the steps 7...11 for other album files.

That's all. This worked for me (Picasa Version 2.7.0 Build 37.3607, 0 for Linux) and I hope this will work for you.

Monday, 9 July 2007

uHuman-soft Metacity theme

This is my first Linux project. I like default Ubuntu theme called Human, but always thought it would be even nicer if I were able to choose my own colours. So after learning about creating metacity and GTK themes I started to play with the theme called "ish" by bvc (http://www.guistyles.com/gnome-styles/). Then I compared my results with the default Ubuntu theme and found that the latest takes three times less to be rendered. So I abandoned it and began modifications of Human. The main differences are:
1. customizable colours
2. minimize, maximize and close icons
3. another way of painting window titles
Here is the screenshot:



The default colour is soft green, but you can change it to anything you like by selecting the "Selected Item" colour in the Themes Customization menu (System - Preferences - Theme - Customize - Colors)
Credits: bvc - close, minimize, maximize and unmaximize icons;
Daniel Borgmann, Billy Cantrell, Richard Stellingwerff - original Human theme files.

Download from here.

How to install a Desktop theme.

Friday, 27 April 2007

Clock

Here is another program I'd like to share. It seems to be much more useful for Windows users comparing with the screen magnifier.

As you can see on the screen shot it is the clock utility called Ranui Clock. Actually "ranui" means midday in Maori, but I would prefer to separate the word and use it as Ra Nui - The Big Sun, it has the same meaning in most Polynesian languages. Ranui is also the suburb where I am currently living.

Main Features:


  • Ranui Clock displays time as an analogue clock with highly customizable appearance. You can select any picture (of the reasonable size) to be used as the clock scale.
  • You can adjust almost every parameter of the image - see the options window screen shot.
  • Precision - it synchronizes itself over the Internet using Time Servers and may also act as a time server for other computers in the same local network with no direct internet access.
  • It can play sounds every second, every half an hour and every hour, as well as when its remainder is showing a message.
  • It can work as the remainder or alarm clock. You can save as many as you wish single or regular events.

Ranui Clock comes with the set of scale images with predefined options for every image for your convenience. You can change any of these options and use any BMP or PNG (recommended) picture as a scale image. It saves your settings for every used image so you don't have to re-adjust them when calling the image back.

The program was tested with Windows 98 (limited visual features), 2000, XP, and pre-releases of Vista with and without Aero theme.

Ranui Clock is distributed as a self-installing executable file (about 1.5 MB).

Download Ranui Clock

Thursday, 19 April 2007

Screen Magnifier

Let start with the simplest applet - a magnifier for your desktop. I use it mainly when I have to adjust the positions of visual components.

Screen Magnifier shows the area around the mouse cursor enlarged by 2, 3, 4, 6 or 8 times. Actually it does nothing more.

Features:
1. magnification rates 2x, 3x, 4x, 6x, 8x
2. semi-transparent mode, so you can see the screen content behind its window
3. can display cross-hair rulers
4. remembers its options when closed, and restores them next start
5. all options are set up via a popup-up menu, which appears when you right-click on the header
6. when the mouse cursor moves inside the program window it becomes completely transparent except for its boundaries and the header. This allows you to work with the applications behind the magnifier's window.

The program was tested with Windows 2000, XP, and pre-releases of Vista with and without Aero theme.

Screen Magnifier is distributed as a self-installing executable file (about 480 kB).

Download Screen Magnifier