New withMetadata([boolean]) to keep metadata in the generated images.

This commit is contained in:
Juliano Julio Costa
2014-08-22 13:53:42 -04:00
parent b877751b2d
commit c5efb77bad
5 changed files with 47 additions and 10 deletions

View File

@@ -130,12 +130,13 @@ sharp('input.png')
.rotate(180)
.resize(300)
.sharpen()
.withMetadata()
.quality(90)
.webp()
.toBuffer()
.then(function(outputBuffer) {
// outputBuffer contains 300px wide, upside down, sharpened,
// 90% quality WebP image data
// with metadata, 90% quality WebP image data
});
```
@@ -278,6 +279,10 @@ Possible interpolators, in order of performance, are:
### Output options
#### withMetadata([boolean])
Specifies if the output image should contains the original metadata or not.
#### progressive()
Use progressive (interlace) scan for JPEG and PNG output. This typically reduces compression performance by 30% but results in an image that can be rendered sooner when decompressed.