我滥用吗?
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
});
我正在尝试其他文件,却再也看不到减小的大小...我缺少什么?