mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Increase control over output metadata (#3856)
Add withX and keepX functions to take advantage of libvips 8.15.0 new 'keep' metadata feature.
This commit is contained in:
@@ -659,6 +659,18 @@ sharp('input.tiff').webp({ preset: 'drawing' }).toFile('out.webp');
|
||||
sharp('input.tiff').webp({ preset: 'text' }).toFile('out.webp');
|
||||
sharp('input.tiff').webp({ preset: 'default' }).toFile('out.webp');
|
||||
|
||||
// Allow a boolean or an object for metadata options.
|
||||
// https://github.com/lovell/sharp/issues/3822
|
||||
sharp(input).withMetadata().withMetadata({}).withMetadata(false);
|
||||
sharp(input)
|
||||
.keepExif()
|
||||
.withExif({
|
||||
IFD0: {
|
||||
k1: 'v1'
|
||||
}
|
||||
})
|
||||
.withExifMerge({
|
||||
IFD1: {
|
||||
k2: 'v2'
|
||||
}
|
||||
})
|
||||
.keepIccProfile()
|
||||
.withIccProfile('filename')
|
||||
.withIccProfile('filename', { attach: false });
|
||||
|
||||
Reference in New Issue
Block a user