How to use the gifwrap.GifUtil.write function in gifwrap

To help you get started, we’ve selected a few gifwrap 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 dadi / cdn / dadi / lib / handlers / image.js View on Github external
return Jimp.read(buffer).then(image => {
    let bitmap = new BitmapImage(image.bitmap)

    GifUtil.quantizeDekker(bitmap)

    let frame = new GifFrame(bitmap)

    let tmpGifFile = `${path.join(tmpDirectory, sha1(this.parsedUrl.original.path))}.gif`

    return GifUtil.write(tmpGifFile, [frame]).then(gif => {
      return fs.unlink(tmpGifFile).then(() => {
        return gif.buffer
      })
    })
  })
}

gifwrap

A Jimp-compatible library for working with GIFs

MIT
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis