PUBLIE : |image_reduire

**SPIP**

# Article validé

L’article "**|image_reduire** (https://www.spip.net/en_article6535.html)"
vient d’être publié par b_b.

* * *

## |image_reduire

lundi 11 mai 2020 , par [jack](.././?page=auteur&id_auteur=593&)

The filter `|image_reduire{largeur,hauteur}` allows to resize an image to a
given size while keeping the proportion of the image.

It is possible to have a parameter `largeur` or `hauteur` equal to zero. In
this case, only the other parameter is taken into account.

If the image provided is smaller than the settings, nothing happens (the
image is not reduced).

Let’s take an image 300x400 pixels

**Example 1 :** Reduce an image with a maximum of 80 pixels in width and
200 pixels in height

1. [ ( #FICHIER |image_reduire {80,200} ) ]

The resulting image is 80x107 pixels.

**Example 2 :** Reducing an image to 200 pixels in height

1. [ ( #FICHIER |image_reduire {0,200} ) ]

The resulting image is 150x200 pixels

**Example 3 :** Indicate a dimension larger than the image

1. [ ( #FICHIER |image_reduire {500,0} ) ]

Calculates a thumbnail but does not enlarge the image. The resulting image
is 300x400 pixels

## See also

**The filters**

* |image\_reduire\_par
(https://www.spip.net/ecrire/?exec=article&id_article=6365)
* |image_recadre
(https://www.spip.net/ecrire/?exec=article&id_article=5786)
* |image\_passe\_partout
(https://www.spip.net/ecrire/?exec=article&id_article=4562)

The article on the Traitement automatisé des images
(https://www.spip.net/ecrire/?exec=article&id_article=3327), also detailing
many other image filters.

— Envoyé par SPIP (https://www.spip.net/)

rubon199.jpg