internal package
Foswiki::Plugins::ImagePlugin::Core ClassMethod
new($session) → $core constructor
ObjectMethod
cache() → $chiCache ObjectMethod
json() → $json returns a JSON object
ObjectMethod
formatHtml5Data($key, $val) → $dataAttr converts the given key-value pair into a proper HTML5 data attribute
ObjectMethod
mage() → $imageMagick createImage()
.
ObjectMethod
createImage() → $imageMagick allocates a new Image::Magick object. Make sure you deallocate it on your own
ObjectMethod
filter() → $filterService ObjectMethod
finishPlugin() deallocates all delegates cached within this core object, i.e. cache, image magick, json and filter objects.
It also clears any outdated thumbnails left behind by image operations.
ObjectMethod
handleREST($subject, $verb, $response) → $result process
REST handler. available url parameters:
ObjectMethod
handleIMAGE($paramas, $topic, $web) → $result %IMAGE
macro
ObjectMethod
parseMediawikiParams($params) %IMAGE
macro
%IMAGE
default parameter.
ObjectMethod
pingImage($imgInfo) → ($width, $height) $imgInfo
parameter
is a has reference that is enriched with the found width and height so
that this method is safe to be called multiple times on the same image
thus caching results within the $imgInfo
record.
It processes the image in
results are cached in
ObjectMethod
pingOrigImage($imgInfo) → ($width, $height, $fileSize) pingImage()
but adding infos about the original image. results are cached in
It processes the image in
and stores results in
ObjectMethod
ping($path) → ($width, $height) $path
. Note that other than the two above
methods pingImage()
and pingOrigImage()
results are not cached whatsoever.
ObjectMethod
processImage($web, $topic, $file, $params, $doRefresh) → $imgInfo $doRefresh
has been specified.
The $params
hash may contain the following properties:
filter
parameter will be delegated to the Filter service at
Foswiki::Plugins::ImagePlugin::Filter
ObjectMethod
afterSaveHandler(undef, $topic, $web, $error, $meta) AutoAttachInlineImages
setting of the plugin
ObjectMethod
extractInlineImages($meta, $text) → $numImages $text
and returns the number of images
found. These will be attached to an existing $meta
object.
Note that $text
is modified in place, replacing any found data with an appropriate
markup to render the newly attached image. See the InlineImageTemplate
plugin configuration.
ObjectMethod
afterRenameHandler($oldWeb, $oldTopic, $oldAttachment, $newWeb, $newTopic, $newAttachment) afterRename operations: flags old thumbnails as deleteable.
ObjectMethod
flagThumbsForDeletion($web, $topic, $attachment) igp_md5...
files which are then renamed by prepending the filename with an underscore (_).
If this thumbnail has to be recomputed yet again, it is re-renamed removing the underscore
again. Any _igp_md5...
files left are considered old and are deleted later on.
ObjectMethod
clearAllThumbs($web, $topic, $attachment) igp_md5...
ObjectMethod
clearOutdatedThumbs($web, $topic, $attachment) _igp_md5...
.
Note the underscore infront of the name.
ObjectMethod
clearMatchingThumbs($web, $topic, $attachment, $pattern) delets all thumbnails for a given pattern
ObjectMethod
takeOutSVG($text) $text
is modified in place.
ObjectMethod
processInlineSvg($data) → $markup $data
found by takeOutSVG()
, attaches them to the current topic
and returns appropriate markup to render it otherwise.
ObjectMethod
inlineError($params) errorMsg
property
of this class. Warnings may be suppressed if $params→{warn}
is
switched off.
ObjectMethod
mirrorImage($web, $topic, $url, $fileName, $force) errorMsg
property is set.
ObjectMethod
getImageFile($web, $topic, $topic, $params) → $fileName igp_md5...
image name for the thumbnail to be processed based on the
$params
.
ObjectMethod
updateAttachment($web, $topic, $fileName, $params) saves the given file as an attachment to the web.topic
See Foswiki::Func::saveAttachment()ObjectMethod
getTemplate($name) → $tmpl loads the named foswiki template or the default template "imageplugin". results are cached for performance reasons
ObjectMethod
readMimeTypes() → $types MimeTypesFileName
.
ObjectMethod
mimeTypeToSuffix($mimeType) → $suffix derives the appropriate file suffix for a given mime type
ObjectMethod
suffixToMimeType($suffix) → $mimeType returns the matching mime type for a given file extension