This is an old revision of the document!


Piwigo Import Tree

This is a script that can be run to import a tree structure of albums of images into Piwigo. Starting with a specified directory, this and all the sub-directories in the tree structure are written as albums in Piwigo with all their JPEG images and Descriptions.

Official page of Piwigo Import Tree (ChangeLog & Download)

Requirements

The script is run using Perl. If this is not available, it can be downloaded and installed from www.perl.org – both ActiveState Perl and Strawberry Perl have been tested with Windows 7.

Usage

The script is run with variables supplied as follows:

perl piwigo_import_tree.pl
    --base_url=http://address/of/your/piwigo
    --user=admin_username
    --password=??
    --directory="my photos directory"
    [--parent_album_id=NN]

Where:

  • –user=admin_username is an administrator on your gallery.
  • –directory=“my photos directory” is the full or relative Path Name to the top of the Album Tree. (If the top directory contains spaces, surround it in double quotes)
  • –parent_album_id=NN is the internal Piwigo Album ID of the parent album. This parameter is optional : if there is no parent album for the albums being loaded, omit this parameter.

These variables may be supplied in any order and indeed most can be edited as defaults in the script using Notepad and then omitted.

If your Piwigo gallery is hosted on Piwigo.com, use settings:

perl piwigo_import_tree.pl
    --base_url=http://YOU.piwigo.com
    --user=YOU
    --password=??
    --directory="my photos directory"

Windows users

To run the Perl Script, go to “Start” then “Run” then “Cmd” to open a Command Window. Use “cd” to change to an appropriate directory. This is useful to go to the top of the tree. Then type the command line as in the example above (best to prepare it and copy & paste).

The command window will then scroll a list of the albums and images written to Piwigo. Each JPG image is transferred full-size.

Photo titles

In addition, if there is a record named Descript.ion present in the directory, (such as that produced from Fotopic), this is read and the Caption for each Image is used as the Piwigo Image Title. These entries consist of lines containing the Image Filename and Caption, separated by a Tab. The default name of this record can be changed to another text file name.

Run many times to synchronize

The most useful part of this facility is that you can add more albums, images and descriptions to the tree structure and then re-run the script when just the new images will be transferred.

 
Back to top
user_documentation/tools/piwigo_import_tree.1339792109.txt.gz · Last modified: 2012/06/15 20:28 by tadjio
 
 
github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact