====== Gallery Plugin ====== The [[doku>plugin:gallery|Gallery Plugin]] allows you to embed an automatically created image gallery into a page. * Author : Andreas Gohr ===== Syntax ===== A basic gallery can be added by selecting a [[doku>:namespaces|namespace]] like this: {{gallery>namespace}} All image files in the selected namespace will be added to the image gallery. Don't forget the ":" in front of the namespace. 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 white space (defaults to centered): {{gallery> namespace}} (right aligned) {{gallery>namespace }} (left aligned) {{gallery> namespace }} (centered) Instead of a namespace, you can also give an HTTP(s) URL to any [[wp>Media RSS]] or ATOM feed with enclosures (as produced by most photo sharing sites like Flickr). The images will then be pulled from that feed instead: {{gallery>http://www.23hq.com/rss/schabloni}} Note: since the question mark is used to separate the parameters (see next section) the URL can not contain any question mark. To use such a feed URL with the gallery plugin, just use one of the many short URL services like [[http://bit.ly]]. E.g. instead of ''%%http://api.flickr.com/services/feeds/photos_public.gne?id=22019303@N00&lang=en-us&format=rss_200%%'' use a shortened URL like ''%%http://bit.ly/HurZM%%''. Additionally, to have thumbnail creation correctly working you need to set [[doku>config:fetchsize]] big enough to get the remote images downloaded. ==== 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''. E.g. 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. | | ''=////'' | ''=0'' | Limits the output to the given number of images. ''0'' means all. | | ''+////'' | ''+0'' | Skip the first number of images. Useful with the option above. | | ''~////'' | ''~0'' | Add a pagination for the thumbnails displaying the number of given thumbnails per page. ''0'' disables pagination. Pagination is added through JavaScript - when no JavaScript is available all thumbnails are displayed | | ''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. | | ''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 | | ''recursive'' | enabled | Find images in the given namespace and all sub namespaces | | ''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 | | ''titlesort'' | disabled | Sort images by EXIF title | | ''showname'' | disabled | Show filename below thumbnails | | ''showtitle'' | disabled | Show the EXIF tag ''Headline'' as 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 opened in lightbox mode. __Example__: {{gallery>?crop&lightbox}} This displays all images in the current namespace using 2 parameters. Parameterlist begins with ''?'' additional ones are concatenated with ''&''. ===== 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 a [[https://github.com/splitbrain/prettyphoto/tree/merged|custom branch]] of the [[http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/|PrettyPhoto]] library)). You can close the picture view by clicking the X button in the lower right corner or anywhere outside the picture. You can move to the next or previous image by using the arrow buttons in the lower left corner, your keyboard or by clicking the left or right side of the image. The picture is downsized if necessary to fit into the current browser window. You can enlarge it with the expand button in the top right corner. The following keys can be used to navigate: ^ Key ^ Action ^ | ''->'' | next image | | ''<-'' | previous image | | ''ESC'' | close the image view | ===== Manipulate EXIF Tags ===== If you want to show a title below the image using the parameter ''showtitle'' it may appear that the title shown is not as you expected (e.g. ''einstein.jpg'' instead of ''Albert Einstein''). If you want to adapt the image's subtitle shown in the gallery, you have to manipulate the EXIF Tag called ''Headline''. You could use the [[http://owl.phy.queensu.ca/~phil/exiftool/|ExifTool]] for which even a [[http://u88.n24.queensu.ca/~bogdan/|Windows GUI]] exists to adapt the EXIF data to your needs. ===== Known Limitations and Caveats ===== ==== Uploading Images ==== Uploading images is beyond the scope of this plugin. Do not request any features regarding this. * Use the [[doku>:media manager]] to upload images one by one * Use the [[doku>plugin:archiveupload]] plugin to upload multiple images in a Zip file * Upload the files manually via FTP to the ''data/media'' directory. Keep in mind that image names need to be valid [[doku>: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 [[doku>:caching]] for details. Optionally use the ''nocache'' parameter of the plugin (not recommended). ==== EXIF Data Problems ==== Problems with accessing [[doku>: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 [[doku>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 not correctly loaded. This is most likely a Browser-Cache issue. Simply follow the steps described for fixing a similar problem with the [[doku>faq:toolbar]]. Also make sure you don't have any conflicting plugin installed. You should **not** install any additional lightbox plugin. ==== Images are not Resized ==== There are different reasons why thumbnails are not created: * libGD extension is missing => Install the extension or configure DokuWiki to use [[doku>config:im_convert|imagemagick]] * libGD extension is installed, but the source image size + overhead is larger than memory_limit set in php.ini => Lower the source image size or increase the memory_limit ==== MediaRSS feed displays "nothing found" ==== When no images from your feed are shown, be sure you don't have a question mark in your URL. Use an URL shortener as suggested above. Also be sure your feed URL (before shortening) starts with %%http://%% or %%https://%% and not with %%feed://%%. The latter is just a renamed HTTP link - simply rename it back. ==== External Images are not Resized ==== As written above, you need to increase the [[doku>config:fetchsize]] config option. Also make sure LibGD or ImageMagick are installed. ===== Demo Installations ===== Here are a few user provided examples of the gallery plugin in use: * http://www.wikipeixes.com.br/ * http://eolienne.f4jr.org/medias/start * http://jerome-remy.com/modecasting/doku.php?id=gallerie_photo:modelles:cindirella * http://www.splitbrain.org/blog/2008-01/04-new_york_impressions * http://trickster.lettere.unipd.it/doku.php?id=seconde_generazioni:turba_mostra * http://gallery.geoectomy.net/ * http://www.hemmerling.com/doku.php/en/repository.html * http://www.favorlinks.com/wiki/coming_soon_page_design FIXME * http://www.heidischneekloth.com/reportagen * http://urbangirlblue.org/ecscc/doku.php * http://photo.hrhiles.com/doku.php?id=photos ===== Discussion ===== Be sure to read the [[#Known Limitations and Caveats]] section first. Questions should be asked in the [[http://forum.dokuwiki.org|forum]]. Bugs and feature wishes should be reported in the [[https://github.com/splitbrain/dokuwiki-plugin-gallery/issues|issue tracker]]. Any comments/discussions on this page will be removed.