gruntjs - 如何在 grunt 响应式图像任务中使用 triage 图像压缩器
问题描述
我想使用 triage 图像压缩器为我的网站压缩图像。我需要为我的 grunt 响应式图像任务中的引擎选项提供什么,以便它可以使用 triage?
我已经在 Windows 上使用 image-magickengine:"im"
在我的 grunt 响应式图像任务中尝试了这个,它运行良好,切换到 ubuntu,我已经安装了 triage 图像压缩器并设置engine:"trimage"
但它会产生错误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"]);
};
解决方案
推荐阅读
- c# - 登录时间活动目录
- api - Youtube API quta 需要购买吗?
- button - 如何去掉按钮点击高亮
- python - 获取与每个 ID 关联的最小日期的行
- python-3.x - 没有任何管理员权限的普通组成员无法看到通过开发中的 facebook 应用程序完成的 facebook 帖子。我该怎么做?
- swift - 你可以通过 url 教 Coreml 吗?
- mysql - 春季 JPA | 在多对多关系中搜索
- android - 有没有办法通过代码重置Android指纹锁
- c++ - std::optional 成员是否连续存储?
- spring-amqp - 获取 ClassCastException,java.util.ArrayList 无法转换为 org.springframework.amqp.core.Message: