Skip to content

Commit c7befc0

Browse files
renuvkelkarpr-Maisjauntybrain
authored
docs(storage-resize-image): update the description for Sharp options param (#1905)
Co-authored-by: Mais Alheraki <[email protected]> Co-authored-by: Pavel Ryabov <[email protected]> Co-authored-by: Pavel <[email protected]>
1 parent 71df739 commit c7befc0

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

storage-resize-images/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ Leave this field empty if you do not want to store failed images in a separate d
9494
* Convert image to preferred types: The image types you'd like your source image to convert to. The default for this option will be to keep the original file type as the destination file type.
9595

9696

97-
* Output options for selected formats: Provide a optional output option stringified object containing Sharp Output Options for selected image types conversion. eg. `{"jpeg": { "quality": 5, "chromaSubsampling": "4:4:4" }, "png": { "pallete": true }}`
97+
* Output options for selected formats: Provide an optional output option as a stringified object containing Sharp Output Options for selected image types conversion. eg. `{"jpeg": { "quality": 5, "chromaSubsampling": "4:4:4" }, "png": { "palette": true }}` and `{"png":{"compressionLevel":9}}`. The `"compressionLevel": 9` specifies the level of compression for PNG images. Higher numbers here indicate greater compression, leading to smaller file sizes at the cost of potentially increased processing time and possible loss of image quality.
9898

9999

100-
* Sharp constructor options for resizing images: Provide a optional output option stringified object containing Sharp Output Options for selected image types conversion. eg. `{ failOnError: false, limitInputPixels: true }`
100+
* Sharp constructor options for resizing images: Provide an optional stringified Sharp ResizeOptions object to customize resizing behavior, eg. `{ "fastShrinkOnLoad": false, "position": “centre”, "fit": "inside" }` The `"fit": "inside"` option ensures the image fits within given dimensions, maintaining aspect ratio, scaling down as needed without cropping or distortion. Learn more about [`Sharp constructor options`](https://sharp.pixelplumbing.com/api-resize#resize).
101101

102102

103103
* GIF and WEBP animated option: Keep animation of GIF and WEBP formats.

storage-resize-images/extension.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,23 +253,30 @@ params:
253253
- param: OUTPUT_OPTIONS
254254
label: Output options for selected formats
255255
description: >
256-
Provide a optional output option stringified object containing Sharp
256+
Provide an optional output option as a stringified object containing Sharp
257257
Output Options for selected image types conversion. eg. `{"jpeg": {
258-
"quality": 5, "chromaSubsampling": "4:4:4" }, "png": { "pallete": true }}`
258+
"quality": 5, "chromaSubsampling": "4:4:4" }, "png": { "palette": true }}`
259+
and `{"png":{"compressionLevel":9}}`. The `"compressionLevel": 9`
260+
specifies the level of compression for PNG images. Higher numbers here
261+
indicate greater compression, leading to smaller file sizes at the cost of
262+
potentially increased processing time and possible loss of image quality.
259263
type: string
260264
validationRegex: ^({(.*?)})$
261-
validationErrorMessage: Please provide a valid json object.
265+
validationErrorMessage: Please provide a valid JSON object.
262266
required: false
263267

264268
- param: SHARP_OPTIONS
265269
label: Sharp constructor options for resizing images
266270
description: >
267-
Provide a optional output option stringified object containing Sharp
268-
Output Options for selected image types conversion. eg. `{ failOnError:
269-
false, limitInputPixels: true }`
271+
Provide an optional stringified Sharp ResizeOptions object to customize
272+
resizing behavior, eg. `{ "fastShrinkOnLoad": false, "position": “centre”,
273+
"fit": "inside" }` The `"fit": "inside"` option ensures the image fits
274+
within given dimensions, maintaining aspect ratio, scaling down as needed
275+
without cropping or distortion. Learn more about [`Sharp constructor
276+
options`](https://sharp.pixelplumbing.com/api-resize#resize).
270277
type: string
271278
validationRegex: ^({(.*?)})$
272-
validationErrorMessage: Please provide a valid json object.
279+
validationErrorMessage: Please provide a valid JSON object.
273280
required: false
274281

275282
- param: IS_ANIMATED

0 commit comments

Comments
 (0)