Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
})
})
})
}