* Update landing page / README.md * Update GETTING_STARTED.md * Update installation.md * Update getting_the_image_info.md * update signing_the_url.md * Update watermark.md * Update presets.md * Update object_detection.md * Update autoquality.md * Update serving_local_files.md * Update docs/serving_files_from_s3.md * Update configuration.md * Update generating_the_url.md * Update chained_pipelines.md but chained pipelines section is not finished * Update serving_files_from_google_cloud_storage.md * Update new_relic.md * Update prometheus.md * Update datadog.md * Update image_formats_support.md * Update about_processing_pipeline.md * Update healthcheck.md * Update memory_usage_tweaks.md * Remove GIF/ICO/BMP/HEIF/AVIF support sections from docs/image_formats_support.md * Minor fixes of the docs * Update serving_files_from_azure_blob_storage.md * Fix issue with x and y offset for 're' watermark property * Fix params description in docs/watermark.md * Fix Alexander Madyankin GH name * Special thanks to Travis * Fix README Co-authored-by: DarthSim <darthsim@gmail.com>
2.1 KiB
Chained pipelines
Though imgproxy's processing pipeline is suitable for most cases, sometimes it's handy to run multiple chained pipelines with different options.
imgproxy Pro allows you to start a new pipeline by inserting a section with a minus sign (-
) to the URL path:
.../width:500/crop:1000/-/trim:10/...
^ the new pipeline starts here
Example 1: Multiple watermarks
If you need to place multiple watermarks on the same image, you can use chained pipelines for that:
.../rs:fit:500:500/wm:0.5:nowe/wmu:aW1hZ2UxCg/-/wm:0.7:soea/wmu:aW1hZ2UyCg/...
In this example, the first pipeline resizes the image and places the first watermark, and the second pipeline places the second watermark.
Example 2: Fast trim
Performing the trim
operation is pretty heavy as it involves loading the entire image into memory from the very start of processing. However, if you're going to scale down your image and trim accuracy is not very important to you, it's better to move trimming to a separate pipeline.
.../rs:fit:500:500/-/trim:10/...
In this example, the first pipeline resizes the image, and the second pipeline trims the result. Since the result of the first pipeline is already resized and loaded to the memory, trimming will be done much faster.
Using with presets
You can use presets in your chained pipelines, and you can use chained pipelines in your presets. However, the behaior may be not obvious. The rules are the following:
- A preset is applied to the pipeline where is was used.
- A preset may contain a chained pipeline, and will be chained to the pipeline where the preset was used.
- Chained pipelines from the preset and from the URL are merged.
Example
If we have the following preset:
test=width:300/height:300/-/width:200/height:200/-/width:100/height:200
And the following URL:
.../width:400/-/preset:test/width:500/-/width:600/...
The result will look like this:
.../width:400/-/width:500/height:300/-/width:600/height:200/-/width:100/height:200/...