From fb7e00067f7f00263d1c540c842d1e1c5036ef6f Mon Sep 17 00:00:00 2001 From: Hideo Matsumoto Date: Wed, 30 Jun 2021 22:08:27 +0900 Subject: [PATCH] Update libsquoosh/README.md code example Add code example to resize with aspect ratio preserved. --- libsquoosh/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libsquoosh/README.md b/libsquoosh/README.md index 3c11e010..af8c9a93 100644 --- a/libsquoosh/README.md +++ b/libsquoosh/README.md @@ -42,11 +42,19 @@ When an image has been ingested, you can start preprocessing it and encoding it await image.decoded; //Wait until the image is decoded before running preprocessors. const preprocessOptions = { + //When both width and height are specified, the image resized to specified size. resize: { enabled: true, width: 100, height: 50, } + /* + //When either width or height is specified, the image resized to specified size keeping aspect ratio. + resize: { + enabled: true, + width: 100, + } + */ } await image.preprocess(preprocessOptions);