|image_select

The filter |image_select preconditions the execution of the processing operations called after it.

  • New in : SPIP 1.9.2

The filter |image_select{width_min, height_min, width_max, height_max} determines the execution of the processing operations called after it. It allows the selection (according to their dimensions) of 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 (removing transparency) against a black background and saved as jpg with a compression rate (quality level) of 85% while images with a height and width between 501 and 2000px will be flattened (removing transparency) against a black background and saved as jpg with a compression rate (quality level) of 50%.

Author jack Published : Updated : 12/07/23

Translations : English, français, Nederlands