Navigatie: User guide >

How does it work

Vorige paginaTerug naar hoofdstuk overzicht

This page is intended for the more technical user, who wants to know how this solution is realized.

 

After some exploring how Picasa works I discovered that everybody can add templates to the HTML export process of Picasa. There is a document in the program files folder \Google\Picasa3\web\documentation\index.html of Picasa, The Picasa Web Templating System, which describes the programming rules how to create HTML or XML files.

 

Further I observed that at the end of export process Picasa opens the created document, which is in most cases the browser for html files and some other program for xml files.

The first trick is that I added the non existing file type .xmt to the system as xml.transfer.document and added the a key xml.transfer.document the default value C:\Program Files\DigitalPhotoExport\DigitalPhotosExporter.exe "%1" in the HKEY_CLASSES_ROOT of the Windows registry.

 

The effect is that the program DigitalPhotosExporter.exe is indirectly called by Picasa by opening the just created file index.xmt of which its full path is passed as parameter.

 

Further I have added during the installation the subfolder photoframe to the Picasa program folder \Google\Picasa3\web\templates\. In the photoframe folder I copied all  files from the subfolder xml. I changed 3 files, which will create a specific formatted file index.xmt  to be used by the utility. These files are:

 

1. imagelistelement.xml,
2. index.tpl and
3. preview.jpg.

 

The user has to select a template during HTML export procedure in Picasa. An additional template is now visible with the name "Digital Photo Frame Export" in the "Select a Web Page Template" dialog. When the user selects this template an image of a digital photo frame is displayed. Picasa fills the index.xmt file using the specifications in the index.tpl and imagelistelement.xmp template files.

 

The resulting index.xmt file is a simple XML file. Hereafter a sample of the content of this file.


<?xml version="1.0" encoding="utf-8" ?>

<album>

<albumName>Utrecht</albumName>

<albumItemCount>4</albumItemCount>

<albumCaption></albumCaption>

<images>

<image>

       <itemName>img_0162.jpg</itemName>

</image>

<image>

       <itemName>img_0164.jpg</itemName>

</image>

<image>

       <itemName>img_0158.jpg</itemName>

</image>

<image>

       <itemName>img_0160.jpg</itemName>

</image>

</images>

</album>


The application reads this data in sequence and copy the <itemName> files to the USB file drive giving a new name based on the name given during the export procedure with a sequence number.

The rest of the application is programming the user interface to interact with the user to get the work done. The programming language used is AutoIt3 http://www.autoitscript.com/autoit3/, a scripting language for the Windows environment.

 

The installation procedure takes the task of adding files and settings to the system, copying files in the locations depending on the version of Windows (Windows XP, Windows Vista or Windows 7). Copy the application settings file and add uninstall software for the removal of the installed software en settings.

 

The application has an ini settings file to remember last used and configuration values. Further it contains the translation of the phrases used in the user dialog window. This ini settings file is located in application data folder of the user. See Questions and answers for the  location of this file.

The later added settings utility is to change the operational values by the user.

 

Version history

0.4.0.8

Removing the white space from the new folder and file names a little too aggressive. Blanks in the names remain present.

0.4.0.7

Settings utility added

0.4.0.6

The maximum length of a name of the photo frame is now a ini file option (default 30, min 10, and max 120)
Bug removed. The max limit was not honored.

0.4.0.5

The random function is added.

0.4.0.4

It detects now all media changes of USB removable drives

0.4.0.3

Detection added to check the presence of media.
When the application was started stand-alone an error caused the termination of the program when the last or default Picasa HTML export folder location was not existing anymore. An error message is added before exiting the application.

0.4.0.2

Added the double click to start the explorer for the click USB drive
Added routine to let the Exit button resurface by de-selection of the USB drive
Added tooltip to inform the user about the double click function on USB drives
Cleanup some code

0.4.0.1

Initial external release to a limited number of users