From 478960455f060c9d377d6bb9947fc70ed20fff7f Mon Sep 17 00:00:00 2001 From: Michael Stingl Date: Mon, 4 Dec 2023 17:28:54 +0100 Subject: [PATCH] Explain processor behavior Based on: https://pkg.go.dev/github.com/disintegration/imaging --- services/thumbnails/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/thumbnails/README.md b/services/thumbnails/README.md index 0d7b4d3883..7de40ce4f0 100644 --- a/services/thumbnails/README.md +++ b/services/thumbnails/README.md @@ -69,10 +69,10 @@ Returned: 15x10 Normally, an image might get cropped when creating a preview, depending on the aspect ratio of the original image. This can have negative impacts on previews as only a part of the image will be shown. When using an _optional_ processor in the request, cropping can be avoided by defining on how the preview image generation will be done. The following processors are available: -* `resize` -* `fit` -* `fill` -* `thumbnail` +* `resize` resizes the image to the specified width and height and returns the transformed image. If one of width or height is 0, the image aspect ratio is preserved. +* `fit` scales down the image to fit the specified maximum width and height and returns the transformed image. +* `fill`: creates an image with the specified dimensions and fills it with the scaled source image. To achieve the correct aspect ratio without stretching, the source image will be cropped. +* `thumbnail` scales the image up or down, crops it to the specified width and hight and returns the transformed image. To apply one of those, a query parameter has to be added to the request, like `?processor=fit`. If no query parameter or processor is added, the default behaviour applies which is `resize` for gif's and `thumbnail` for all others.