Closed fun4wut closed 3 years ago
CC #16 顺便修了个typo
export function imageminCompress({ ctx, info }: CompressOptions): Promise<ImgInfo> { ctx.log.info('imagemin 压缩开始') return getImageBuffer(ctx, info.url) .then((buffer) => { ctx.log.info('imagemin 压缩完成') return imagemin.buffer(buffer, { plugins: [mozjpeg({ quality: 75, progressive: true }), upng()], }) }) .then((buffer) => { ctx.log.info('imagemin 压缩失败') // <=应该是压缩完成吧 return { ...info, buffer, } }) }
CC #16 顺便修了个typo