tools/photogallerypluginattach.pl
.
Run it as the same user Foswiki runs as (often this is the www-data
system user).
The script will "properly" attach images using the Foswiki engine (as opposed to
directly "hack" it into the topic database). This makes sure that the attachment
owner and all other meta data are correct and it also uses the automatic JPEG
rotatation and timestamp features described above (if this plugin is
activated). The script is not limited to photos or this plugin in general. It
can be used to attach arbitrary files (even without this plugin installed).
Example: tools/photogallerypluginattach.pl -C -g -u WikiUsername Main.HolidaysInTheUpsideDown /path/to/photos/*jpg
%SCRIPTURLPATH{"rest"}%/PhotoGalleryPlugin/resize
. It takes the following
parameters:
topic
– (required) the topic from which to take the attachment (Web.Topic format)
name
– (required) name of the attachment in that topic
quality
– (optional) JPEG quality factor of the generated thumbnail
width
– (required) width in pixels of the generated thumbnail
height
– (required) height in pixels of the generated thumbnail
ver
&ndash: (optional) attachment version, used to invalidate cache
uid
– (optional) image version (serial), used to invalidate cache
<img src="%SCRIPTURLPATH{"rest"}%/PhotoGalleryPlugin/thumb?topic=Sandbox.PhotoGalleryPluginTest;name=IMG_1262.jpg;quality=85;uid=0;width=200;height=150"/>
Gives (if plugin is activated):
{Plugins}{PhotoGalleryPlugin}{ExifTranPath}
– path to the exiftran
utility
{Plugins}{PhotoGalleryPlugin}{QualityDefault}
– the default thumbnail quality factor
{Plugins}{PhotoGalleryPlugin}{DateFmtDefault}
– the default time format to render timestamps
{Plugins}{PhotoGalleryPlugin}{CaptFmtDefault}
– the default caption format for thumbnails and photos
{Plugins}{PhotoGalleryPlugin}{AdminDefault}
– the default admin mode
{Plugins}{PhotoGalleryPlugin}{SizeDefault}
– the default thumbnail size
{Plugins}{PhotoGalleryPlugin}{HeadingFmtDefault}
– the default day heading format
cd /path/to/foswiki perl tools/extension_installer <NameOfExtension> installIf you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.
This plugin needs the exiftran
utility installed on the system in order to provide the photo rotation feature
described above. In Linux distributions the package is typically called
"exiftran" and can be installed through "package managers" or "software
centres". Try the command sudo apt-get install exiftran
on Debian and
derivates.
The Image::Epeg Perl module, required
for fast JPEG thumbnail generation, might not be available as a system
package. It can be downloaded from CPAN and be built and installed manually (see
e.g. here).
For other graphics formats
Graphics::Magick or
Image::Magick is used to generate
thumbnails. No thumbnails will be shown if none of these is available.
photogallery
(for JPEG rotation and timestamp options) and/or bulkupload
(for bulk
uploading) to the SKIN
list in SitePreferences. See Skins for
details.
The bulkupload
skin extension also works without activating this plugin.
Installing the RenderPlugin is recommended
with this skin extension (see Dependencies below).
working/work_areas/PhotoSwipePlugin
directory. It will keep the timestamps of
the used files up-to-date. The plugin ships with a script to clean up the cache
by removing old files from the cache directory. It is suggested to install a
cronjob to run the script on a regular basis. Run
tools/photogalleryplugincleanup.pl -h
to see the built-in help for more
details. Alternatively, standard system tools, such as "tmpreaper", can be used
to remove old files. No harm is done removing them all from time to time.
Name | Version | Description |
---|---|---|
JSON | >=0.1 | Required for REST handler feedback (not sure which version is the minimal requirement) |
Image::ExifTool | >=0.1 | Required for extracting and displaying photo meta data (not sure which version is the minimal requirement) |
File::Copy | >=0.1 | Required for photo manipulation operations (not sure which version is the minimal requirement) |
Error | >=0.1 | Required for error handling (not sure which version is the minimal requirement) |
POSIX | >=0.1 | Required for file operations (not sure which version is the minimal requirement) |
Digest::MD5 | >=0.1 | Required for caching (not sure which version is the minimal requirement) |
Storable | >=0.1 | Required for caching (not sure which version is the minimal requirement) |
File::Touch | >=0.1 | Required for caching (not sure which version is the minimal requirement) |
List::Util | >=0.1 | Required (not sure which version is the minimal requirement) |
Image::Epeg | >=0.13 | Required for fast thumbnail generation |
Image::Magick | >=0.1 | Optional (this or Graphics::Magick) for PNG/GIF/SVG thumbnail generation (not sure which version is the minimal requirement) |
Graphics::Magick | >=0.1 | Optional (this or Image::Magick) for PNG/GIF/SVG thumbnail generation (not sure which version is the minimal requirement) |
Foswiki::Plugins::JQueryPlugin | >=6.32 | Required for everything |
Foswiki::Contrib::FamFamFamContrib | >=1.9 | Required for action menu items |
Foswiki::Plugins | >=2.1 | Required plugin interface |
Foswiki::Plugins::RenderPlugin | >=4.10 | Optional for the bulk upload skin extension |
Date | Version | Comments |
---|---|---|
9 Jan 2021 | v1.16 | - minor fixes - fix html problem with filenames that contain WikiWords - fix bug where clicking a thumb would sometimes open another picture |
5 Jul 2018 | v1.15 | - fix attachment meta data - fix bulk upload skin extension for installations that don't use the strikeone request validation thingy - fix gallery layout for a Firefox weirdness when layout.css.devPixelsPerPx is non-integer (HiDPI screens) |
28 Jun 2018 | v1.14 | - fix an uncritical warning - remove leading and trailing whitespace from edited filenames - fix for installations that don't use the strikeone request validation thingy |
25 Feb 2018 | v1.13 | - fix default parameter - handle errors in regular expression in images parameter- add example on how to select all supported picture and graphics |
25 Dec 2017 | v1.12 | - Add random parameter to randomly select a number of attachments.- Add reverse date and name and random sorting ( sort paramter).- Allow empty thumbcap and zoomcap to disable captions.- Add minimal support for PNG, GIF and SVG graphics. - Document thumbnail REST handler. - Various minor code/css/docu improvements. |
23 Dec 2017 | v1.11 | - highlight last viewed photo's thumbnail when exiting fullscreen viewer - add width and float parameters for more layout control |
23 Dec 2017 | v1.10 | photo gallery plugin: - documentation cleanup - when leaving viewer, only scroll page if thumb is not fully visible, only animate y axis bulk upload skin extension: - allow specifying for what files a upload form attribute is usable, and used that to allow the rotate and timestamp attributes only for jpeg images - allow double-clicking attribute checkboxes to propagate state to other pending files - notify (warn) user if attachment table could not be refresed (RenderPlugin missing) |
11 Mar 2017 | v1.9 | - set minimal Foswiki required to release 2.1.3, see Foswiki:System/ReleaseNotes02x01 - update photogallery.tmpl to use the new mechanism of adding attachment properties to the attach dialog, see Foswiki:Tasks/Item14092 - allow re-ordering pending items in the upload queue (bulk upload skin extension) |
23 Dec 2016 | v1.8 | - widen file size column in bulk upload form to avoid clipping of text - remove all use of JQueryUITooltip in bulk upload form as it doesn't work well, rely on browser tooltip instead - allow renaming the file name in the bulk upload form before uploading - consider that Foswiki may change the uploaded file name to remove illegal characters - various style improvements in the bulk upload form - scroll thumbnail view to last viewed photo on exit of fullscreen - remove dead links from fullscreen caption |
12 Nov 2016 | v1.7 | - move file upload properties to the upload items in the bulk upload form for easier editing - completely replace PatternSkin upload form with bulk upload form - minor improvements and documentation updates |
9 Sep 2016 | v1.6 | - bulk upload improvements: replace unreliable jquery ui tooltips on buttons with a help twisty, highlight uploaded files in attachments table - improve file properties editing in bulk upload form - display average upload speed in bulk upload progress bar - improved, simplified and optimised image info caching code (no visible changes) - prevent thumbnails from being unnecessarily regenerated on PageCaching refresh and other circumstances - improve and cleanup various code and documentation bits |
19 Jun 2016 | v1.5 | - add bulk upload skin extension that extends the standard PatternSkin attach page with bulk upload capabilities - remove TopicInteractionPlugin skin extension - make the whole thumbnail area clickable while the thumbnail image is being loaded - various cleanup and small improvements |
29 May 2016 | v1.4 | - minor cleanup (remove duplicate function, fix dependency file) |
16 May 2016 | v1.3 | - add possibility to automatically split galleries into individual days by injecting customisable headings - minor documentation improvements |
1 May 2016 | v1.2 | - add cache cleanup script - improve bulk upload script - force meta data and thumbnail cache update when attachment version changes - fix plugin crash when all attachments are unreadable (file gone, but FILEATTACHMENT still there) - fix display of timestamp admin menu entry - allow saving empty comment - improved various bits in the plugin code |
21 Apr 2016 | v1.1 | - cleanup and improve docu - fix setting EXIF exposure date on upload - add bulk upload script |
15 Apr 2016 | v1.0 | - initial released version |