Category : image-resizing

How to fix Error: Stream yields empty buffer in Node.js v14.15.3? Here is some code how I use ImageMagick to process images: const gm = require(‘gm’).subClass({ imageMagick: true }); const resize = (imageStream, width, height) => new Promise((res, rej) => { gm(imageStream.on(‘error’, rej)) .resize(width, height, ‘>’) .noProfile() .toBuffer(‘jpeg’, (err, data) => (err ? rej(err) : ..

Read more