Skip to content

Commit

Permalink
Add metadata option (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristofferGersen authored and sindresorhus committed May 25, 2019
1 parent d42c69b commit 5f05d27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ module.exports = opts => buf => {
args.push('-resize', opts.resize.width, opts.resize.height);
}

if (opts.metadata) {
args.push('-metadata', Array.isArray(opts.metadata) ? opts.metadata.join(',') : opts.metadata);
}

args.push('-o', execBuffer.output, execBuffer.input);

return execBuffer({
Expand Down
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ Type: `Object { width: number, height: number }`

Resize the image. Happens after `crop`.

##### metadata

Type: `string | string[]`<br>
Default: `none`<br>
Values: `all` `none` `exif` `icc` `xmp`

A list of metadata to copy from the input to the output if present.

#### buffer

Type: `Buffer`
Expand Down

0 comments on commit 5f05d27

Please sign in to comment.