Pierrick on Piwigo

Piwigo is the open source photo gallery for the web

Virtualize your categories

In Piwigo, when you transfer photos via FTP in your “galleries” directory and register them with the synchronization process, you create physical categories. This is the way Piwigo has worked in its 8 first years. If I remember correctly, Piwigo 1.3 introduced the virtual categories in 2003. The idea was to create  a logical hierarchy of categories, not related to filetree in the “galleries” directory. With virtual categories came virtual links: a photo can be associated to several categories at once.

The problem with physical categories it the lack of control: for example, you can’t easily move a category. If you move a directory under “galleries”, the synchronization process doesn’t understand that the directory has moved: the category is deleted and another one is created. You lose the photo description, the user comments and so on.

Piwigo 2.0 introduced a new automatic organization for your photos on the server filesystem in 2009. Photos are automatically stored in upload/Year/Month/Day/YearMonthDayHourMinuteSecond-Random.jpg, for example upload/2011/03/08/20110308102611-af34bcc9.jpg. The original filename is registered in the database. Categories are virtual, you can move them the way you want and informations related to photos are never lost. This storage method is used in the web upload form and with all remote softwares like pLoader, Lightroom, Shotwell, Digikam, Jiwigo… Unless you use the synchronization to add photos, there is nothing in your “galleries” directory.

Piwigo.com does not propose the FTP + synchronization method to add photos. Several Piwigo.com users have asked to migrate their Piwigo gallery into Piwigo.com and when we see photos in the “galleries” folder, we use a script to move  files from the “galleries” to the “upload” directory. On Piwigo.org forums we sometimes have the question:

how do I move a category without losing photo properties?

so I’ve decided to convert my Perl script into a Piwigo plugin : Virtualize.

convert manual filetree into automatic filetree

convert manual file tree into automatic file tree


Written by plg

March 8, 2011 at 9:59 am

Posted in piwigo, piwigo.com, plugin

%d bloggers like this: