Extension:EImage

EImage allows users use images from external hosts and storage used clips into local cache. Images may be thumbnailed/resized/framed/cropped just like a local images. The syntax used is very similar to MediaWiki's Images syntax. EImage can also do overlay the base image by text (or image). Templates, wiki syntax or translation can be used too.

Installation
For full support, 'EImage requires the following external tools to be available:
 * exiftool for support including the exif tags (Debian package )
 * DjVu Libre for support DjVu multipage docs (Debian package )
 * pdftocairo for support export PDF pages into SVG with crop functionality (Debian package )
 * cairosvg for support export SVG into PDF (Debian package )

Syntax and Examples
EImage to disposition this types of functions:
 * Image (#eimage) : The "main" options for displaying the image. This is similar to MediaWiki's Images.
 * Annotations (#eimagea): This is a separate parser function for an annotation. You can have as many of these as you want.
 * New functionality (in progress since 3.1 version) #eimg to replace tag 'img' (depreceted from MW 1.39+). More important for me, that replace it my wikitext template Template:block, and local PHP script crop.php
 * New functionality (in progress since 3.1 version) #eibox, get feature as my wikitext template Template:block. For example see my sandbox, where it's tested. -- Want (talk) 18:58, 10 March 2023 (UTC)
 * Functions usable to get info about image (or another type of file) :
 * #eimgw : get width of file
 * #eimgh : get height of file
 * #earea : get info about width and height of the file, in #eimage usable form
 * #eimgsize : get size of the file for humans
 * #eimgmime : get mimetype (usable in templates)
 * #epages : get info about number of pages; usable in templates for multipage file detection
 * #eimgexif : get exif tags from local file -  recommend (experimental)
 * #epath : get path of file, without server

#eimage
The full syntax for displaying an image is:

Refer to http://www.mediawiki.org/wiki/Help:Images for detailed descriptions. Below is a list of options available in EImage:

First parameter, URL of the image to display. If a raw URL is entered, you will need to also specify the width and height. If you want use image from local wiki, we can use Magic word, which can be parametrized. For example:

Next usable options:
 * Format : border or frameless
 * Resizing : {width}x{height}px
 * Horizontal alignment : one of inline and/or left, right, center, none
 * Position : inline, displays the image(+frame) inline instead of as a floating block (it overrides the float option). Works best with none. Useful for displaying multiple thumbnails on one line.
 * Vertical alignment : one of baseline, sub, super, top, text-top, middle, bottom, text-bottom
 * Link : link={target} Currently only links that start with http/https/ftp are supported.

These options change the defaults for all annotations in an image (not all images). If no annotations are used, these are ignored:
 * Horizontal alignment : aalign=
 * Background color : abg= (default is transparent)
 * Font family : afamily=
 * Font size : asize=
 * Font weight : aweight=
 * Font style : astyle=
 * Font shadow : ashadow=
 * Font color : acolor=
 * Line height : aheight=

Last position parameter is accepted every as alternative note of image.

Some examples:

If wiki has configured by Manual:$wgForeignFileRepos using images from another wiki, i.e. commons.wikimedia.org, we can use function #epath

If use local image, you can use functions #earea:

or #eimgh and #eimgw, which can be use wit combination with parserfunctions, for dynamic resize.

#eimagea
Each image can have any number of annotations. In the tag use the annot= option to specify an annotation. The value of annot= is another function called . Below are the options available for :
 * Horizontal alignment option: one of left, right, center, justify, inherit
 * Background color option: bg=
 * Font parameters :
 * family : family=
 * size : size=
 * weight : weight=
 * style : style=
 * shadow : shadow=


 * Font color : color=
 * Line height : height=

If a parameter does not match any of the other possibilities, it is assumed to be the annotation text. Annotations support wiki-formatting.

Some examples:

#eibox
It's rework my Template:block (wikicode) into PHP code. Derrivated from Template:Image in July 2020. For now it's usable without background image support. In the future it replace the #eimage function, which use absolute measure and depends on the obsolete variable. Next example demonstrate using #eibox:

Next code, was used by my Template:block:

#eimg
The function #eimg extend #eibox. Use similary syntax, which is based on my Template:Image, originated on the original wiki syntax used by MW to the image insert. In simply form is very easy for use.. Compare with the MW syntax: But typically using MW syntax is more complexity: But proble with the MW syntax is that doesn't allow set the size percentage. It was my start idea for Template:Image create. The following code does almost the same thing as MW code, but sets the percentage width. In June 2020, the functionality of the template was extended with the possibility of cropping by external wrapper crop.php. Cropping is a basic functionality for my wiki. It non sense for me do manually crop of the image, and after upload it, then I can do it by the extension EImage on-the-fly, using the original source by need. For now use my wiki about hundreds clips generated on-the-fly by PHP script 'crop.php'.

But I gradually replace this with the #eimg function, because use cache, which decrease processor load. For now the EImage support JPEG, GIF, PNG, SVG, PDF and DJVU format. Toto je stejný kód uvedený výše, realizovaný přes #eimg:

For more examples using see my test pages:
 * https://www.thewoodcraft.org/wiki/index.php/P%C3%ADskovi%C5%A1t%C4%9B
 * https://www.thewoodcraft.org/wiki/index.php/test-eimage

History

 * Extension EImage was created in 2011 by Robert Pooley, who was working as an IT Infrastructure specialist for Symantec. His inspiration was Template:Annotated image (Wikipedia). His idea: to integrate images from other sites into MediaWiki pages as background layers, and add on top layers with notes in wiki code and anothers images, was cool.
 * His implementation supported services as Flickr, or … fot it used file  where found inspiration how-to convert   links common in Flickr comments to wiki-formatted links.
 * In 2013 Robert change jobs and pushed the code to Github repository: https://github.com/Robpol86/EImage.git


 * Thewoodcraft.org has used EImage since 29 May 2018, (MW 1.24.1 and PHP 5.x), but after upgrading to MW 1.33-wmf.22 (29. March 2019) with dependency on PHP 7.3, the code of this extension needed repair. The first serious use of it was the documentation page of Template:Image, where is used for demonstrate errors on the screenshots.
 * On 19 February 2021‎, Pppery archived this page, because the download link was pointing to a GitHub repository marked as "This repository has been archived by the owner on Dec 13, 2020. It is now read-only."
 * After upgrading Thewoodcraft.org to MW 1.39.2 (24. February 2023), I found out this fact, and that's why I decided to maintain this extension in addition to the Extension:AccessControl, and add other features used on my site. From the last version (waiting to repository created), I removed unusable code, and added functions from another orphaned extension used by me. New functions  and   (origin at Extension:ImageSizeInfoFunctions) and were the inspiration for next function   -- Want (talk) 10:37, 4 March 2023 (UTC)