mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-15 18:19:47 +00:00
Update README.md
To close typo in example code as reported in issue #1051
This commit is contained in:
committed by
GitHub
parent
9a37cc7959
commit
5e14444b13
@@ -39,9 +39,9 @@ The returned `image` object is a representation of the original image, that you
|
|||||||
When an image has been ingested, you can start preprocessing it and encoding it to other formats. This example will resize the image and then encode it to a `.jpg` and `.jxl` image:
|
When an image has been ingested, you can start preprocessing it and encoding it to other formats. This example will resize the image and then encode it to a `.jpg` and `.jxl` image:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
await image.decoded; //Wait until the image is decoded before running preprocessors
|
await image.decoded; //Wait until the image is decoded before running preprocessors.
|
||||||
|
|
||||||
const preprocessOptions: {
|
const preprocessOptions = {
|
||||||
resize: {
|
resize: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
width: 100,
|
width: 100,
|
||||||
@@ -50,7 +50,7 @@ const preprocessOptions: {
|
|||||||
}
|
}
|
||||||
await image.preprocess(preprocessOptions);
|
await image.preprocess(preprocessOptions);
|
||||||
|
|
||||||
const encodeOptions: {
|
const encodeOptions = {
|
||||||
mozjpeg: {}, //an empty object means 'use default settings'
|
mozjpeg: {}, //an empty object means 'use default settings'
|
||||||
jxl: {
|
jxl: {
|
||||||
quality: 90,
|
quality: 90,
|
||||||
|
|||||||
Reference in New Issue
Block a user