Uses
This filter can be applied to
- the path of the image (the #FICHIER tag)
- an html tag
<img src=... />
(See The #LOGO_XXX tags or the filter |balise_img)
Crop to absolute dimensions
The arguments are:
|image_recadre{width, height, position, background colour}
- width;
- height;
- position (optional) :
-
center
,left
,right
,top
,bottom
; - or combinations of several
top left
; - or an indication in pixels from a position
top=50
or composedtop=40 left=50
; - or the name of a special function that will calculate and return the desired position.
-
- the background colour (optional) argument is useful if you enlarge the image.
Examples with absolute dimensions
[(#FICHIER|image_recadre{800, 400})]
[(#LOGO_ARTICLE|image_recadre{800, 400, center})]
[(#LOGO_RUBRIQUE|image_recadre{800, 400, center, black})]
[(#FICHIER|image_recadre{90,90,center})]
Crop the original image into a square of 90 px width and height based on the centre of the image.
It is possible to have a width or height parameter equal to 0. In this case, only the other parameter is taken into account.
|image_recadre
also allows to enlarge an image file, the background is then specified by a colour or ’transparent’ as the 4th argument:
[(#FICHIER|image_recadre{500,300,'top left','#663399'})]
Crop to proportions
Arguments are:
|image_recadre{proportions, +|-, position, background colour}
- proportions : ratio width:height required;
- +|- : ’+’ to enlarge with stripes, ’-’ to reduce. (if ’-’ is applied, it is equivalent to |image_passe_partout);
- position (optional) : Cutting position indication:
-
center
,left
,right
,top
,bottom
; - or combinations of several
top left
; - or an indication in pixels from a position
top=50
or composedtop=40 left=50
; - or the name of a special function that will calculate and return the desired position.
-
- background colour (optional), argument is useful if you enlarge the image.
Examples with proportions
[(#FICHIER|image_recadre{16:9, '-'})]
[(#LOGO_BREVE|image_recadre{1:1, '-', center})]
[(#FICHIER|image_recadre{16:9, -, top left})]
[(#FICHIER|image_recadre{16:9, -, top=40 left=20})]
[(#FICHIER|image_recadre{16:9, +, center, white})]
Allows you to have a logo in 16:9 format with as little cropping of the image as possible.
This keeps the image as large as possible while keeping to a proportion.
Example
[(#LOGO_ARTICLE|image_recadre{1:1,-,center top})]
See also
The filters
The article on the Automatic image processing, also detailing many other image filters.