Photo Finishing Products and services |
PictaTroveLast updated: 2008 Oct 12 | Pipeline Industry |
120px above accounts adds again along areas cellpadding come complete configuration currently custom div downloads edit family feb generating generator groups head hosting hr imaging india industry let lets listing log mainly members message necessary note pictatrove produce publishing quickly reason remove return script select sept sheet shutdown sub try until wants whole |
Photo Sharing Server News
IntroductionPictaTrove is a small, dedicated, web server that allows one to share a selected set of photographs over the web. It works for both Windows and Linux platforms.PictaTrove was written with the assumption that the site administrator (sysop - system operator) would have a large set of unedited photographs already organized in directory trees and that he wants to publish some selected sub-sets of these. PictaTrove evolved from my earlier work with PhotoTrove, which went through about three major versions before undergoing a redesign to simplify the configuration and administration of the program. At which time PhotoTrove became PictaTrove. PictaTrove is a standalone web server, written in Python that dynamically builds photo-gallery web pages out of original photographs. It does a number of things, such as:
At the time of first publication (6 Aug 2006) PictaTrove was not returned by a Google search! On 11-Aug-06 Google returned the first hit, which was for the domain name registration. Sample Slide ShowsHere are some example slide shows that will give you an idea of what PictaTrove can produce (this is the general-user interface). Whenever the current page is loaded or refreshed the two thumbnails below will display a different photo from each show at random (this is a feature of one of the query URLs that the PictaTrove server supports).
LicenseThis is free for use, a shareware version in C++ for Windows may be available later.DownloadingThe current version of PictaTrove is available in this zip file: pictatrove2007-01-01.zip. See release notes below.InstallingFor the first versions you will need to install the Python environment on your computer, along with a support package known as PIL, the Python Imaging Library. To install these things you should download their installers and then just following the installation instructions. I have written this using Python 2.3, and it should work with newer versions of Python too. You can find the appropriate install packages here:
If you are going to run this on Windows then you must also install the Python Win32 Extensions package, the install kit can be found on this page.
Once you have done this you can install my PictaTrove program
[zip file]. Just unzip the contents of this to some handy directory (I
used E:\temp\picta in the example below) and
the installation is complete. This directory will contain some Pyhton
files (*.py) a config.ini file and some subdirectories. As a test you
should be able to start the web server by just running: python
appserver.py
At this time and then start a web browser and connect to
http://localhost:8881 you should get a simple page with some broken
links. As well some web server activity log output should be written to
the console: E:\temp\picta>python appserver.py Log directory: 'log' does not exist, logging disabled 2006-08-09 12:58:17 - 0 - appserver started 2006-08-09 12:58:17 - 0 - read config file 2006-08-09 12:58:17 - 0 - Made new slideshows directory 'supportdata/slideshows' when you create a "log" directory this will be sent to a log file in that directory. Next, shut down the server, and add a sysop user to the list of accounts (which is in accounts.txt and is currently empty). Use the commands: mkdir log
The first command creates a directory for log files to be written in.
The second command creates a user (called "somename" and gives him a
password) an MD5 digest version of this is stored in the accounts.txt
file. The third command adds the sysop group to the user's
account record.
python user.py +user somename somepassword python user.py +group somename sysop Tour of the Sysop InterfaceNow restart the server and enter the URL: http://localhost:8881/contact?dir=/photos into your browser. You will be prompted for a username and password, enter those for the sysop account you just created and you should now get a contact sheet view of some sample photos (these are stored in the "data" directory that came with the pictatrove zip file, but are displayed as if they are in the web directory "/photos").Note: PictaTrove does not modify any of the original photos, if you need to annotate, rotate, resize or crop photographs it will make a new version based on the original on the fly and save this new version in a cache directory, from the cache directory it will be sent out to the web browser. The contact sheet gives you access to the directory tree of photos, you can go up the tree by clicking on the up-icon and enter sub directories by clicking on their names. As well, the contact sheet allows you to access a larger view of each photo (the details page) by clicking on the photograph's thumbnail image. The contact sheet also has some additional links:
Details PageThe detals page for any photograph allows you to do some simple editing and annotation functions. To fix the rotation click on the "Rotate CCW" (CCW stands for counter clockwise) button. If you now return to the contact sheet (by clicking the up-icon) the contact sheet will also be updated.The "Edit XML" button allows you to add titles and descriptions to the photograph. The "Edit Photo" button allows you to crop the photograph (or remove or change existing cropping). This functions by using a Java applet in the web browser to select the cropping area - for this reason you will need a browser that allows the running of Java applets. Note this applet can sometimes take about 10 seconds to start, and sometimes the image does not appear until you wave your mouse over the browser or resize the browser window. The "Add to show" button is used to add the currently displayed photograph to the end of the default slide show - see the next topic. Creating Slide ShowsTo create a slide show you will need to go to a contact sheet page and then click on the "Slide shows" link at the bottom of the page. This will display the "Slide Show Listing" page, to create the first slide show enter a name (say "test1") in the "Add new show" text field and then click on the "Create show" button. Once the show is created you need to make it the default show (by clicking on the "set as default" link - which will highlight it in the table) so that the "Add to show" button on the details pages will work.Now hit the "Home" link to go to the topmost contact sheet and then select the first photo, click on its "Add to show" button. Doing this will add the photo to the slide show and also take you to the details page of the next photo in the directory. Click on the "Add to show" button again. You now should have a slide show with two pictures in it. At this time go back to the slide shows listing page and the slide show table should now show a thumbnail image of a random slide in the show. Click on this image to see the show. You can use the edit link in the slide show table to change settings relating to the slide show (such as image sizes). Use the show edit function to add a group called "public" to the groups that are allowed to see the show - the public group is a special group that does not require the user to log into any account to see a show's contents. Now close your browser and restart it - this is the best way to make sure you have changed accounts. Then go to the URL http://localhost:8881/slidelist? you should now see a slightly different view of the list of slide shows, with no editing capability, you can click on the first slide show to see it as a public user, and the few pictures in the slide show should be all the public user has access to. Creating additional user groupsYou can create additional user groups to control access to slide shows and the regular HTML page areas if you need to. There is always a built in "public" group which needs no authentication (so is suitable for links that should be available to anyone on the web). There is also a built in "sysop" group. The config files that were included also define a third group "family".
Groups appear in the [access] area of the config.ini file, where you
will see lines like: [access]
what this section means is that URLs which start with "/photos" are
only accessible to members of the sysop group, those that start with
"/extras" are accessible to everyone (with or without authentication).
Note the "/extras" area is where things like the up and down arrow
icons and the top level index.html file come from.
/photos=sysop /familycache=family /sysopcache=sysop /publiccache=public /extras=public The three URLs with "cache" in them establish who can access which cache directory. In the pt/config.ini file there is a [groups] section which lists the groups and the names of the cache directories used for each. Publishing DirectoriesOnce you have the test system running you will probably want to reconfigure it so that it can publish an existing directory tree of your photos. To do this you will need to edit the [roots] and [access] areas of the main config.ini file. By default these look like:[roots]
/photos=data /familycache=familycache /sysopcache=sysopcache /publiccache=publiccache /extras=extras [access] /photos=sysop /familycache=family /sysopcache=sysop /publiccache=public /extras=public Lets say you have a photo collection that starts in the directory C:\mydata\photos, you can replace the existing mapping by just changing the [roots] area to look like: [roots]
/photos=c:/mydata/photos you should just leave the access set to sysop. Then restart the appserver and you should be able to build slide shows based on this set of photos.
If you have photos that are stored in other directory trees as well,
perhaps on other drives or even on other machines you can add
additional lines for them. Note that there is only one "default
root" which is configured in the pt/config.ini file as
"rootdir=/photos", this is used by the "Home" link, so if you have
multiple directory trees you might want to edit the index.html file to
include entry points for them for your browsing convenience. In
the following example I have added two more roots, one called
"/oldphotos" and the other called "/olderphotos", the "/olderphotos" is
even located on another machine in a share called "cdrive" (which
should work but I have not tested... a mapped drive letter will also
work).
[roots]
/photos=data /oldphotos=d:/some/old/photos /olderphotos=//servername/cdrive/very/old/photos /familycache=familycache /sysopcache=sysopcache /publiccache=publiccache /extras=extras [access] /photos=sysop /oldphotos=sysop /olderphotos=sysop /familycache=family /sysopcache=sysop /publiccache=public /extras=public RunningOn LinuxFor a short term test you might just want to start the server manually (as above), but eventually you will want it to start at boot time. There are a number of ways of doing this, here is one of them. Create a small shell script to start pictatrove:#!/bin/sh
Then in the /etc/init.d directory you will find some scripts for
starting and stopping services, among these might be an example (under
Debian this is called "skeleton"), you can modify a few variables near
the top (DESC, NAME, DAEMON) to reference your script to start
PictaTrove and then save as a file called "picta". Do a "chmod"
to set up the execute and read permissions so it matches the other
scripts in that directory. Then go to the directory /etc/rcS.d
and make a symbolic link to it, naming it something like S85picta, the
command to do this would be "ln -s /etc/init.d/picta S85picta"
cd /home/tools/picta python appserver.py & To test to see if you've got it set up you can try "/etc/init.d/picta start" to start it running. The big test to see if this has been configured correctly is to do a "shutdown -r now" and reboot the system to see if the server starts by itself when the machine finishes the reboot. On WindowsOnce you have determined the server works correctly from the command line, you may want to configure it so that it runs as a Windows service, and thus is available whenever the machine is running (even if no one is logged in).to do this one needs to make a number of paths absolute, and modify a line in appserver.py and in service.py... details to follow soon. One Time PadAs PictaTrove does not currently support SSL connections I have implemented a one time pad system to protect passwords that are remotely entered when new accounts are created or old accounts edited. Note: this does not apply to the normal password entry that is used for user authentication as that is already well protected by the browser-based digest authentication protocol.
Before you can use most of the remote user administration functions you
will need to create a one time pad. To do this you run the makeotp.py program, with a command
such as: makeotp.py
c:\some\directory\of\lots\of\files
The program will search the directory tree, and if there are enough
files of at least 8K in size then it will proceed with generating a
file called otp.txt in the
current directory. You then need to modify the config.ini file to add a line like:otpname=otp.txt
to the [server] section so
that the server can locate the one time pad when it needs to decrypt
something.
If you ever do so much editing that you use up all the keys in the one time pad (or you believe your one time pad has been compromised), then you will need to generate a new copy of otp.txt and reset the server's idea of what has been used, which you can do by stopping the server, erasing the file: nextotp.dat, and restarting the server.
Release Notes
Additional Suggestions for ImprovementThis section lists some suggestions for improvement in PictaTrove that have been received from other users. There's no promise that I'll do any of these things, but unless I've specifically stated I'm not going to do something, there is a chance that I'll address these in some future version. |