diff --git a/Resources/doc/filters/general.rst b/Resources/doc/filters/general.rst index b0b35047..048d2c2b 100644 --- a/Resources/doc/filters/general.rst +++ b/Resources/doc/filters/general.rst @@ -130,6 +130,81 @@ Interlace Options ``plane``, and ``partition``. +.. _filter-resample: + +Resample +-------- + +The built-in ``resample`` filter provides a resampling transformation by allows you to +change the resolution of an image. This filter exposes a number of `resample options`_ which +may be used to configure its behavior. + +.. tip:: + + Resampling changes the image resolution (also known as "pixel density") of an image + and is useful when you need to present different versions of an image dependent on + the user's screen density. For example, you may need to provide a "normal" and a + "retina" variant. + + The use of "resolution" is not to be confused with "dimensions". This filter does not + affect the dimentions of an image, only the pixel density. + + +Example configuration: + +.. code-block:: yaml + + # app/config/config.yml + + liip_imagine: + filter_sets: + + # name our filter set "my_resample_filter" + my_resample_filter: + filters: + + # use and setup the "resample" filter + resample: + + # set the unit to use for pixel density + unit: ppi + + # set the horizontal pixel density + x: 72 + + # set the vertical pixel density + y: 72 + + # set the resampling filter + filter: lanczos + + # set the temporary path to use for resampling work + tmp_dir: /my/custom/temporary/directory/path + + +Resample Options +~~~~~~~~~~~~~~~~ + +**unit:** ``string`` + Sets the unit to use for pixel density, either "pixels per inch" or "pixels per centimeter". + Valid values: ``ppi`` and ``ppc``. + +**x:** ``int|float`` + Sets the horizontal (x) pixel density to resample the image to. + +**y:** ``int|float`` + Sets the vertical (y) pixel density to resample the image to. + +**filter:** ``string`` + Sets the optional filter to use during the resampling operation. It must be a string resolvable + as a constant from `Imagine\Image\ImageInterface`_ (you may omit the ``FILTER_`` prefix) + or a valid fully qualified constant. By default it is set to ``FILTER_UNDEFINED``. + +**tmp_dir:** ``string`` + Sets the optional temporary work directory. This filter requires a temporary location to save + out and read back in the image binary, as these operations are requires to resample an image. + By default, it is set to the value of the `sys_get_temp_dir()`_ function. + .. _filter-strip: Strip diff --git a/Resources/doc/filters/sizing.rst b/Resources/doc/filters/sizing.rst index 6b6f04f6..424b7b2c 100644 --- a/Resources/doc/filters/sizing.rst +++ b/Resources/doc/filters/sizing.rst @@ -53,6 +53,10 @@ Thumbnail Options Sets the generated thumbnail size as an integer array containing the dimensions as width and height values. +**allow_upscale:** ``bool`` + Toggles allowing image up-scaling when the image is smaller than the desired + thumbnail size. + .. _filter-fixed: Fixed size diff --git a/Resources/doc/post-processors/png-opti.rst b/Resources/doc/post-processors/png-opti.rst index e90b1c17..b3cb0114 100644 --- a/Resources/doc/post-processors/png-opti.rst +++ b/Resources/doc/post-processors/png-opti.rst @@ -49,6 +49,12 @@ Options When multi-images are encountered (for example, an animated image), this causes one of the images to be kept and drops the other ones. Depending on the input format, this may be either the first or the most relevant (e.g. the largest) image. +**strip_all:** ``bool`` (deprecated) + Removes all comments, EXIF markers, and other image metadata. + +**level:** ``int`` + Sets the image optimization factor, from 0 to 7. + **strip:** ``bool|string`` When set to ``true``, all extra image headers, such as its comments, EXIF markers, and other metadata, will be removed. Equivalently, the string value ``all`` also removes all extra metadata. diff --git a/Resources/doc/post-processors/png-quant.rst b/Resources/doc/post-processors/png-quant.rst index d7ead67c..f62901e2 100644 --- a/Resources/doc/post-processors/png-quant.rst +++ b/Resources/doc/post-processors/png-quant.rst @@ -59,4 +59,4 @@ Parameters ---------- **liip_imagine.pngquant.binary:** ``string`` - Sets the location of the ``pnquant`` executable. Default is ``/usr/bin/pngquant``. + Sets the location of the ``pngquant`` executable. Default is ``/usr/bin/pngquant``.