Image Galley
I'm currently developing an image gallery plugin for TWiki. I want to create something with the functionality of eg.
LiveFrame
, with (of course) all the usual benefits of a Wiki. Everybody should be able to add comments to pictures, or pictures to galleries, or whatever. Use you imagination...
ideas
This image gallery should integrate nicely in the overall Wiki concept. So, it should use the
TextFormattingRules as far as possible, it should enable everyone to edit the gallery (or parts of it, like 'just the comments'), it should make it possible to create a gallery using only a browser, etc.
features
- create gallery from within browser
- automatic thumbnail generation
- 'preview' and 'display' modes
- uses attached files for image storage
Use individual Wiki pages for every image, or use one document which is filtered through the module? I think using individual pages for each image is the better way to do this. Those pages will be initially generated by the plugin, but will spend the rest of their lives like any normal Wiki page. They should include some means to navigate the gallery, of course (like 'next', 'previous' and 'index' links to the gallery preview.
the preview mode
In the preview mode, the gallery browser should present a thumbnail view of the gallery. This can be either a horizontal or vertical column of images, or a page-filling 'contact sheet'. One of the main uses for this preview mode is the use within other pages through the %iNCLUDE{...}% directive.
The preview mode will scan the METADATA for attachments, create thumbnails for those files which don't already have one, and create the preview page. The thumbnails will link to individual pages per image, named after the gallery and a stripped version of the filename. So an image named
123-100-yukon_sunset-123456.12A.jpg in a gallery named
YukonExpedition would lead to a thumbnail names
preview-123-100-yukon_sunset-123456-12A.jpg linked to a page named
YukonExpedition123100yukonsunset12345612A . Not exactly pretty, true, but it is a valid
WikiWord. If you want better page names, make sure your images have descriptive names without all the numerical gunk I use...
the display mode
In the display mode, the browser should display a single image, with attached comments, and some means to navigate to the previous/next image. Display mode is not a real mode, it is just the name I give to the initially generated page.
Comments?
I'm in the first stage of building this thing. So, if anyone has anything intelligent to say on this subject (or point me to an already existing project...), please do...
--
FrankDeLange - 21 Jan 2002
Excellent!
LiveFrame
is in my opinion
the best gallery cgi out there (I have been using it for 6 months now). If the system is to use individual pages (which would be great) it would be fantastic if everything was meta/form based. The
META PARENT could determine the gallery a pic belongs too, and other
META data could specify the thumbnail, and display options.
Look forward to the first release!
--
AdrianLynch - 21 Jan 2002
Me too! Are you going to tell the
LiveFrame people of your plans? They might be inspired by what is possible.
--
MartinCleaver - 21 Jan 2002
To simplify thingsyou could consider to attach all files (including thumbnail versions) to the same topic and use some
SpreadSheetPlugin magic to click through the images. See
TWikiSlideShowEngine and example slide show in action at
Main.TWikiPlatformPresentation.
--
PeterThoeny - 22 Jan 2002
Well, that (attaching all files to the 'Gallery' subject, embodied by the 'preview' page) was the plan, yes. I'll have a look at that spreadsheet link, once I figure out how to get that link to do what it should. Currently it produces a '400 Bad Request' response...
... (time passes, sound of chirping crickets)
Allright, saw the slide show page (by correcting a typo in the URL above). Nice... but I think a problem with that approach for the purpose of a photo gallery in which computer-illiterate people should be able to add comments is the presence of said
SpreadSheetPlugin magic... I wouldn't want my mother to edit that page, chances are she would either be too scared to change anything, or she might just mess up the whole gallery by accidentally changing something which had better been left alone...
But, that could probably be solved by using a form... So, I'll look in to it.
I want the final output pages for the gallery to look just like any other page, maybe with some small navigation thingy somewhere but no other clutter. The preview page should be flexible, so that it can either display:
- a horizontal or vertical bar of preview images (a la LiveFrame
) which can be %INCLUDE{}%'d in other pages (to achieve something like this site
I made for friends and family (please be gentle with my underpowered, cable-modem connected server...). If you follow one of the links in the list you'll get a page with a column of preview images to the left and right of the story. Those preview images currently lead to an instance of LiveFrame
on the same machine, but I eventually want to keep everything within TWiki.
- a contact sheet with images
- a page with a single bar of images and comments to the side
- etc.
Now for the purpose of those preview bars, it would be really handy to use glitzy
HTML-features like layers or IFRAMEs (so the preview bar can be scrolled horizontally or vertically without disturbing the rest of the page)... I might add an option to do that, but it should be no more than an option as all that fancy
HTML-stuff tends to keep some people from enjoying the site.
- *RFI*
- there does not seem to be an 'official' way to access METADATA from within a plugin, at least
Plugins.pm does not contain a function to do so. The documentation also mentions this as a shortcoming of the current METADATA implementation. Also, while Plugins.pm tells me StartRenderingHandler gets called with $meta as the fourth parameter, in reality it only seems to be called with $text and $web. So, before I go off and use some internal function, is there something I'm missing here?
--
FrankDeLange - 22 Jan 2002
All you say about accessing meta data by plugins is correct, the current API is not ready yet. Please don't take the
$meta parameter in
StartRenderingHandler for granted, because the spec for accessing meta data is not done yet. Until then you could use some undocumented (aka TWiki internal) functions and risk that it likely will break with a TWiki upgrade.
--
PeterThoeny - 23 Jan 2002
Ack...
ApresMoiLeDeluge it shall be then, we'll see when it breaks.
--
FrankDeLange - 23 Jan 2002
It looks as if some of the comments got duplicated so I tried to clean them up - apologies if I cut a unique one by accident (incompetence, not malice)
Frank, looks cool. As a stop-gap, you can get a pretty good 80/20 photo album using only existing TWiki features, see
TWikiPhotoAlbum. Kudos to Frank for taking on the last 20% (which as we all know takes 80% of the effort)!
--
TobyCabot - 24 Jan 2002
Over the weekend I tried two approaches (using the
most excellent perlmagick package). First I tried on-the-fly thumbnail generation but that was pretty painful on my PII/450, so I hacked
bin/upload to generate thumbnails during the upload process. There's a small cost in terms of disk space but page serving is much, much faster and more efficent in terms of CPU so I think that's the way to go.
There's proof-of-concept code at
TWikiPhotoAlbum, but it needs some PerlSavvy TWikiSavvy lovin' before it's ready for prime time.
--
TobyCabot - 29 Jan 2002

I checked in an improved version of
ImageGalleryPlugin. it supports now a
format parameter which formats the output for each image. This format (and also other paramerts) supports variable substitution (e.g. $date, $comment, ...). Using this concept, ist's possible to create tabels, lists, ... of images. The only disadvantage is the need of
...empty parameters to format the last row of an incomplete filled table. Has somebody a better idea?
Probably there could be a merge of the upload method for genarating thumbnails and the on-line generation? When both are stored in the same place (paths), then they can profit from each other. The advantage of
ImageGalleryPlugin is the ability to surround the gallery by some context e.g. some text opening/closing. For the
TWikiPhotoAlbum (if I understand it correctly), there is no possibility to customize each single gallery. The only possibility is to change the skin (template) for the page generation.

An still missed feature ist the possibility of sorting the image by some criteria, or to select/order only some images from the attached files.
--
RobertSuna - 01 Feb 2004