Gallery2:Modules:picasa - Gallery Codex
Personal tools

Gallery2:Modules:picasa

From Gallery Codex

Picasa Module

Description

This module lets you import albums from Picasa 2 into Gallery 2. It will keep the order, the captions and the names.

Features

Adds Picasa 2 xml import functionality

Usage

  • Exporting From Picasa

(Also see: How to Add Items from Picasa

To export from Picasa you right click an album and click on "Make a Webpage" (or you choose "Folder/Export as Webpage or even ctrl-w)" from the menu), from there you select the sizes, and the export folder location. In the next window you need to choose "XML Code", and off it goes. Then you navigate to the folder you just chose and beam that up on your Gallery Server.

Or you can directly try using the new "Tools>Experimental>Publish via FTP..." function in Picasa. This uses the same export function as "Make a Webpage", but lets you then choose/configure an FTP account where Picasa will directly upload the folder. This eliminates the need for a manual upload using a separate FTP client.

  • Importing Into Gallery 2 (From Add Item)

The new feature to this module is that any user can import files from Picasa by simply clicking on "Add Item". A Picasa 2-Tab will appear where a local ZIP file can be selected. That ZIP file has to contain a picasa export (index.xml being in the root of the archive). The user also can select how picture titles, summaries and descriptions are assigned.

  • Importing into Gallery 2 (From Site Admin)

Once you have activated the module you get a new entry "Picasa 2" in the Import section of your Administration menu. If you click on that it will let you select the local path to the Picasa export directory which should be stored locally (there will be upload support in the future). You also select the album you want to import your album into. Valid local paths are relative folder paths to your Gallery 2 installation, end with a slash and don't include any file information (no need to point to the xml-file itself). Example: "../upload/myexportedalbum/" would point to the just uploaded folder "myexportedalbum" in the parent folder "upload" that is on the same level as your Gallery 2 install.

Thereafter it should do everything by itself and report back to you.

Requested Features

It would be nice if the Site Admin version also allowed you to choose how captions were assigned.

Integration with Picasa API - This is now covered by the Picasa Web Upload module.

Hacks

If you do not enter a caption Picassa will automatically copy the itemName into the itemCaption field. Personally if I don't enter a caption on a photo, I would prefer it remain un-captioned. To prevent captions from being duplicates of the itemName simply modify the code as described below:

Edit GALLERYROOT/modules/picasa/classes/Picasa2DataParser.class at line 211.

Delete:

           $albumArray['images'][$i]['caption'] = $imageArray[$i]['itemCaption'];

and Replace with:

           if ($imageArray[$i]['itemName'] == $imageArray[$i]['itemCaption']){
               $albumArray['images'][$i]['caption'] == '';
           } else {
               $albumArray['images'][$i]['caption'] = $imageArray[$i]['itemCaption'];
           }

Bugs

Currently there are no known issues for this module.

Notes

The module doesn't like "&" in the captions of exported pictures. This is not a bug since Picasa's the one generating invalid XML.