mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 16:57:26 +00:00
@@ -81,7 +81,7 @@ When you have encoded an image, you normally want to write it to a file.
|
|||||||
This example takes an image that has been encoded as a `jpg` and writes it to a file:
|
This example takes an image that has been encoded as a `jpg` and writes it to a file:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const rawEncodedImage = (await image.encodedWidth.mozjpeg).binary;
|
const rawEncodedImage = (await image.encodedWith.mozjpeg).binary;
|
||||||
|
|
||||||
fs.writeFile('/path/to/new/image.jpg', rawEncodedImage);
|
fs.writeFile('/path/to/new/image.jpg', rawEncodedImage);
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user