====== Gallery Plugin ====== ---- plugin ---- description: This Syntax Plugin allows you to embed an automatically created image gallery into a page. author : Andreas Gohr email : andi@splitbrain.org type : syntax lastupdate : 2008-12-18 compatible : depends : conflicts : similar : tags : gallery, images, pictures, lightbox ---- ===== Download ===== Use the following link in the plugin manager or to download the plugin manually. * {{http://dev.splitbrain.org/download/snapshots/gallery-plugin-latest.tgz}} ==== Changes ==== {{rss>http://dev.splitbrain.org/darcsweb/darcsweb.cgi?r=dwplugins/gallery;a=rss}} ===== Syntax ===== A basic gallery can be added by selecting a [[:namespaces|namespace]] like this: {{gallery>namespace}} All imagefiles in the selected namespace will be added to the image gallery. Instead of using a whole namespace of images, you can also specify a single image -- this makes most sense when combined with the lightbox mode (see below). {{gallery>namespace:someimage.jpg}} The created gallery can be aligned by using whitespace (defaults to centered): {{gallery> namespace}} (right aligned) {{gallery>namespace }} (left aligned) {{gallery> namespace }} (centered) ==== Parameters ==== A number of parameters can be set by appending them with ''?'' character to the namespace or image. Each parameter needs to be separated with a ''&'' character. Defaults for all parameters can be set in the config manager. If a parameter is enabled by default it can be disabled in the syntax by prefixing it with the syllable ''no''. Eg. the parameter ''cache'' is usually enabled and can be disabled using the keyword ''nocache''. Below is a list of all recognized parameters ^ Parameter ^ Default ^ Description ^ | ''////x////'' | ''%%120x120%%'' | Sets the size for thumbnails. Unless the crop option is set, this is a boundary box into which the thumbnail will be fitted, maintaining the correct aspect ratio. | | ''////X////'' | ''%%800X600%%'' | Sets the size for the linked images in ''direct'' mode. This is a boundary box into which the image will be fitted, maintaining the correct aspect ratio. Note the uppercase ''X''.| | ''////'' | ''5'' | The number images per row in the gallery table. If you specify a 0 no table is used instead all thumbnails are added in a sequence. | | ''cache'' | enabled | Usually the output of the created gallery is cached. When the images in your selected namespace change, you have to manually force an update of the gallery page's [[:caching|cache]]. To disable the cache for the page showing the gallery, set ''nocache'' as option. | | ''crop'' | disabled | Make thumbnails the exact given thumbnail size big, cropping when needed. [[devel:develonly|needs DokuWiki development version]] | | ''direct'' | disabled | Link thumbnails with the bigger sized images not with their detail page | | ''lightbox'' | disabled | Show images in a fancy JavaScript modal browsing window, see below for details. Setting this option automatically implies the ''direct'' mode | | ''reverse'' | disabled | Reverse the order of the displayed images | | ''random'' | disabled | Sort images randomly. You might want to use ''nocache'' as well | | ''modsort'' | disabled | Sort images by file modification date | | ''datesort'' | disabled | Sort images by EXIF date [[devel:develonly|might only work in DokuWiki development version]] | | ''titlesort'' | disabled | Sort images by EXIF title [[devel:develonly|might only work in DokuWiki development version]] | | ''showname'' | disabled | Show filename below thumbnails | | ''showtitle'' | disabled | Show EXIF title below thumbnails | | anything containing a ''*'' | jpg,gif,png images | This can be used to filter the list of files found in the given namespace. ''*'' work as simple wildcard symbol. | Example: {{gallery>images:vacation?image_*.jpg&80x80&crop&lightbox}} This displays all images beginning with ''image_'' and ending in ''.jpg'' from the namespace ''images:vacation''. Thumbnails are cropped to 80x80 pixels and images will be openend in lightbox mode. ===== About the Lightbox mode ===== This mode will open the clicked picture inside the current browser window without leaving the current page((This feature is based on the [[http://www.huddletogether.com/projects/lightbox/|Lightbox]] and [[http://serennz.cool.ne.jp/sb/sp/lightbox/|Lightbox Plus]] scripts with some additions)). You can close the picture view by clicking the little X in the upper right corner or anywhere in the picture. You can move to the next or previous image by using the arrow buttons in the lower corners. The picture is downsized if necessary to fit into the current browser window. You can enlarge it with the arrow button in the top corner. The following keys can be used to navigate: ^ Key ^ Action ^ | ''->'' or ''n'' | next image | | ''<-'' or ''p'' | previous image | | ''x'' or ''c'' or ''ESC'' | close the image view | The Lightbox feature will also be used for all images embedded using the standard DokuWiki image syntax and having set the ''direct'' parameter. This behavior can easily be disabled by changing the ''lightboxForEveryImg'' variable to ''0'' at the very top of the ''script.js'' file. Note: The feature does not use [[http://www.huddletogether.com/projects/lightbox2/|Version 2]] of the Lightbox script because of its heavy and DokuWiki-incompatible dependencies. ===== Known Limitations and Caveats ===== ==== Uploading Images ==== Uploading images is beyond the scope of this plugin. Do not request any features regarding this. * Use the [[:Mediamanager]] to upload images one by one * Use the [[plugin:archiveupload]] plugin to upload multiple images in a Zip file * Use the Flash Uploader in the current [[devel:develonly|development]] version of DokuWiki to upload multiple files * Upload the files manually via FTP to the ''data/media'' directory. Keep in mind that images need to be valid [[:pagenames]], all lowercase, no spaces or special chars! ==== Caching ==== The gallery output is cached by default. When you add pictures later, they may not show up in the gallery: add ''&purge=true'' to the end of the URL to clear the cache. See [[:caching]] for details. Optionally use the ''nocache'' parameter of the plugin (not recommended). ==== EXIF Data Problems ==== Problems with accessing [[:exif|EXIF or IPTC]] data in the images, should be reported as DokuWiki bugs and not for this plugin. All EXIF handling is in DokuWiki core. Currently EXIF Data is expected in UTF-8 encoding. There are some problems fetching the correct date from images, these are fixed in the current [[devel:develonly|development]] version of DokuWiki. ==== Lightbox Problems ==== When the lightbox mode doesn't work and instead images are simply opened in the same window, the JavaScript was correctly loaded. This mostly a Browser-Cache issue. Simply follow the steps described for fixing a similar problem with the [[faq:toolbar]]. ==== Images are not Resized ==== When no thumbnails are created, then your PHP install is missing the libGD extension. Either install the extension or configure DokuWiki to use [[config:im_convert|imagemagick]] instead. ===== Demo Installations ===== Here are a few user provided examples of the gallery plugin in use: * http://www.splitbrain.org/blog/2008-01/04-new_york_impressions * http://www.elliotj.com/wiki/doku.php/photos * http://trickster.lettere.unipd.it/doku.php?id=seconde_generazioni:turba_mostra * http://www.downgrade-vista.com/doku.php/gallery ===== Discussion ===== Be sure to read the [[#Known Limitations and Caveats]] section before asking questions here. === Requests === * **Ability to handle a very large collection of images** * **Possibility to link single images to a given internal/external link** \\ \\ === Crashes with too many images === **When I add by FTP more than about 200 MB images, and set "RANDOM", \\ the plugin crashes.** \\ \\ **Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 263436 bytes) \\ in /web/htdocs/www.downgrade-vista.com/home/lib/plugins/gallery/syntax.php on line 291** \\ \\ Thanks, and keep the good work ! [[weekipedia@gmail.com|Nestor]] \\ \\ ps: when I try to handle more folders at once, and one of the folders has too many images, \\ I also get this : \\ \\ **Warning: fread() [function.fread]: Length parameter must be greater than 0 in /web/htdocs/www.downgrade-vista.com/home/inc/JpegMeta.php on line 960** \\ \\ **Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 267969 bytes) in /web/htdocs/www.downgrade-vista.com/home/lib/plugins/gallery/syntax.php on line 291** \\ \\ __One simple solution : could you tell the plugin, to pick up also the different folders in a RANDOM way ?\\ \\ It should first shuffle the different folders. What do you think ? __ \\ \\ pps: it seems that it doesn't show all the images in a given directory. \\ What about a database ? I want to make a gallery of some giga. Maybe a database would help ? \\