我想使用修整图像压缩器为我的网站压缩图像。我需要在发出咕声的响应图像任务中为引擎选项提供什么,以便它可以使用裁切?
我已经在Windows上使用grunt响应图像任务中的engine:"im"
使用图像魔术贴来尝试了此操作,并且效果很好,切换到ubuntu,我已经安装了修整图像压缩器并设置了engine:"trimage"
,但它会产生错误[ C0]
Warning: Invalid render engine specified Use --force to continue.
在线图像压缩器-module.exports = function(grunt) {
require("load-grunt-tasks")(grunt);
grunt.initConfig({
responsive_images: {
dev: {
options: {
engine: "trimage",
sizes: [
{
width: 300,
suffix: "_sm",
quality: 60
},
{
width: 500,
suffix: "_md",
quality: 60
}
]
},
files: [
{
expand: true,
src: ["*.{gif,jpg,png}"],
cwd: "images_src/",
dest: "img/"
}
]
}
}
grunt.registerTask("default",["responsive_images"]);
};
Compressor / index.html