Home:ALL Converter>imagemagick gm node buffer file conversion

imagemagick gm node buffer file conversion

Ask Time:2021-09-22T05:47:51         Author:vertige

Json Formatter

I'm currently using ImageMagick and gm to process images from a buffer. My problem is that I cannot control what file types are put in the buffer but wish to have everything turned to jpg.

Not sure how to do that using the buffer since I'm not giving it an output file path with extension.

gm(buf).command('convert').in('-auto-orient','-resize','500x','-quality','92','-strip','-quality','100','jpg').toBuffer((err, buffer) => err ? reject(err) : resolve(buffer));

Author:vertige,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/69275902/imagemagick-gm-node-buffer-file-conversion
yy