How to use the mozjpeg.replace function in mozjpeg

To help you get started, we’ve selected a few mozjpeg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github meowtec / Imagine / modules / optimizers / mozjpeg.ts View on Github external
io(input: string, output: string) {
    const { quality = 70 } = this.options

    const mozjpegBinFixed = mozjpegBin.replace('app.asar', 'app.asar.unpacked')

    return spawn(mozjpegBinFixed, [
      '-quality',
      quality.toString(),
      '-outfile',
      output,
      input,
    ], {
      capture: [ 'stdout', 'stderr' ],
    }).catch(e => {
      throw new Error(e.message + '\n' + e.stderr)
    })
  }
}

mozjpeg

mozjpeg wrapper that makes it seamlessly available as a local dependency

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Popular mozjpeg functions