diff --git a/index.js b/index.js index c2fd802..0dc2f04 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ module.exports = options => async buffer => { paletteReduction: true, interlaced: false, errorRecovery: true, + strip: true, ...options }; @@ -23,8 +24,6 @@ module.exports = options => async buffer => { } const arguments_ = [ - '-strip', - 'all', '-clobber', '-o', options.optimizationLevel, @@ -32,6 +31,11 @@ module.exports = options => async buffer => { execBuffer.output ]; + if (options.strip) { + arguments_.unshift('all'); + arguments_.unshift('-strip'); + } + if (options.errorRecovery) { arguments_.push('-fix'); } diff --git a/readme.md b/readme.md index cd10567..ddeaf6e 100644 --- a/readme.md +++ b/readme.md @@ -93,6 +93,13 @@ Default: `true` A reasonable amount of effort will be spent to try to recover as much data as possible of a broken image, but the success cannot generally be guaranteed. +##### strip + +Type: `boolean`
+Default: `false` + +Strip metadata objects from a PNG file. + #### buffer Type: `Buffer`