1

我在滥用它吗?

let imgBuff = /* my image buffer is here */

console.log("file type", fileType(imgBuff)); // -> debug { ext: 'jpg', mime: 'image/jpeg' }
console.log("before!", imgBuff.toString("ascii").length); // -> before! 28991

imagemin
  .buffer(imgBuff, null, {
    plugins: [imageminJpegtran(), imageminPngquant({ quality: "10", strip: true })]
  })
  .then(files => {
    console.log("after", files.toString("ascii").length); // -> after 28991
  });

我正在尝试使用不同的文件,但永远看不到尺寸的减小......我错过了什么?

4

0 回答 0