PUBLIE : |image_select

**SPIP**

# Article validé

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

* * *

## |image_select

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

The filter **`|image_select`** conditions the execution of the processing
operations called after him.

The filter **`|image_select{width_min, height_min, width_max,
height_max}`** *(since S P I P 1 . 9 . 2
(https://www.spip.net/ecrire/?exec=article&id_article=3567))* conditions
the execution of the processing operations called after him. It allows to
select (according to their dimensions) the images on which the filters that
follow it will be applied.

**Example :** use a different jpg compression rate depending on whether the
original images are more or less than 500 pixels wide and 500 pixels high

    [(#TEXTE|image_select{0, 0, 500, 500}|image_aplatir{jpg, 000000, 85}
             |image_select{501, 501, 2000, 2000}|image_aplatir{jpg, 000000,
50})]

In the example above, images with a height and width between 0 and 500px
will be flattened (remove transparency) against a black background and
saved as jpg with a compression ratio (quality level) of 85% while images
with a height and width between 501 and 2000px will be flattened (remove
transparency) against a black background and saved as jpg with a
compression ratio (quality level) of 50%.

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

rubon199.jpg