MoinMoinGallery User Documentation
Installation Guide
Download the latest Gallery.py macro from the MoinMoinGallery page and place it either in your global macro directory (MoinMoin/macros) or preferably in your local macro directory (yourwiki/data/plugins/macros)
- Ensure that the file is readable by your webserver process
chmod 444 Gallery.py
Check your SystemInfo page to ensure that you can see Gallery.py listed in either the Global or Local macros section
Usage Guide
- Place the following code on any wiki page:
[[Gallery]]
- Upload some images as attachments to that page
- You should now see those images as a table of thumbnails inserted at the position of your macro code.
Parameters
As of version 0.80 the parameters are as follows:
[[Gallery(key1=value1,key2=value2....)]]
- where the following keys are valid:
- thumbnailwidth = the width in pixels of the thumbnails generated
- webnailwidth = the width in pixels of the webnails generated
- numberofcolumns = the number of columns in the html table used to display the thumbnails (this may be deprecated in future versions if floating css thumbnails are implemented)
For example:
[[Gallery(thumbnailwidth=128,webnailwidth=640,numberofcolumns=4)]]
Advanced Options
gallerytempdir
The default behaviour is to serve the images via MoinMoin's internal attachment view facility. This has the downside that each image then causes a separate invocation of the MoinMoin application.
There are a number of ways around this such as:
Running MoinMoin using fastcgi or mod_python (untested)
- Using an alias in your web config file to alias the attachment requests to direct webserver requests
These methods have pros and cons, the cons including serious security implications.
The preferred method for getting around this is to insert an extra couple of parameters into your wikiconfig.py:
- gallerytempdir
- gallerytempurl
These point to a directory which you have created to be writable for the MoinMoin process and readable by the webserver process such that it can serve images placed there as items in it's urlspace.
gallerytempdir defines the filesystem location of the writable directory
gallerytempurl defines the web accessable url to reach the directory
The MoinMoinGallery macro will create a new directory for each pagename that utilises the MoinMoinGallery macro, it will then, on first view, populate it with thumbnails and webnails for the images contained in the pages attachements directory, eg:
gallerytempdir = '/var/www/html/moin/nails' gallerytempurl = url_prefix + '/nails'
FAQ
Question: I uploaded a heap of images and only some of them seem to be displayed as thumbnails.
Answer: New images are processed into thumbnails and webnails by the MoinMoinGallery macro. If this process takes longer than 40 seconds, then rather than keeping you waiting, the processing moves into the background. You should see a message displayed when this occurs.
The thumbnail generation process was taking too long so it has been backgrounded. Please try again later to see the full set of thumbnails.
Question: Why didn't you implement feature X?
Answer: Probably because this macro was thrown together on the weekend
If you have a feature suggestion, bug (or preferably bug-fix), please email it to me. Question: Why is thumbnail view so slow to appear on my browser?
Answer: By default the macro delivers images using MoinMoin's internal attachment view mechanism. Read the Advanced section of the documentation and implement the moin_config gallerytempdir and gallerytempurl variables or change your MoinMoin setup to use FastCGI
Question: Gallery shows my images larger than the original image size. Any tips on how to avoid that? - DavidCollantes - http://www.shurl.us/DavidCollantes
Answer: The default settings on the gallery are for large images (eg from a 3.3 megapixel digital camera) so you may need to change the thumbnail width and the webnail width so that they are smaller than most of your images. eg: [[Gallery(thumbnailwidth=160,webnailwidth=200,numberofcolumns=6)]]. It would be nice if the macro could check that the dimensions of the images are not smaller than the thumbnail and webnail sizes before generating them. This might be something for a later release.