Comments (5)
input.format 设置为 "png,gif"就能把png和gif一起合并了
from ispriter.
目前可以排除掉不想合并的图片, 可以使用通配符, 查看 https://github.com/iazrael/ispriter/blob/master/CONFIG.md 看详细说明.
/**
* 排除不想合并的图片, 可使用通配符
* 也可以直接在 css 文件中, 在不想合并的图片 url 后面添加 #unsprite, iSpriter 会排除该图片, 并把 #unsprite 删除
*
* @optional
* @example
* "ignoreImages": "icons/*"
* "ignoreImages": ["icons/*", "loading.png"]
*/
"ignoreImages": ["*logo.png"],
from ispriter.
{
"debug": true,
"workspace": "../../", // 相对于当前目录, ../../ 也就是根目录
"input": {
"format": "png,gif",
"cssRoot":"test/css/style.css",
},
"output": {
"cssDist": "examples/test1/css/",
"imageDist": "../img/",
"margin": 30,
"copyUnspriteImage": true
}
}
D:\nodejs\12\test\examples\test1>ispriter -c config.json
1389247490932 not match image bg: url(../img/add_01.gif)
<<<===================
1389247490934 not match image bg: url(../img/add_02.gif)
<<<===================
1389247490935 not match image bg: url(../img/add_03.gif)
<<<===================
Output image: examples\test1\img\sprite_style.png
Output css: examples\test1\css\style.css
All done: Time use: 85 ms
然后只把png合了,gif的没有合。output里面也尝试加了 "format": "png,gif", 但还是有问题。会在imageDist目录生成一个.png.gif的文件。
from ispriter.
不好意思, 我刚刚测试了 gif, 目前 node-png 不支持读取gif图片, 所以还无法合并 gif, 我会在下个版本加上 gif支持
from ispriter.
期待...
from ispriter.
Related Issues (20)
- 为什么不试试peaches? HOT 5
- 关于合并图片的建议 HOT 2
- 增加支持百分比设置background-position的样式
- 对animation动画中的背景图片, 也要进行合并
- 智能给没有设置宽高的样式增加宽高 HOT 1
- 合并后的css部分hack样式消失 HOT 7
- 合并图片只能合并png格式 HOT 1
- 增加能够指定某些图片合并为一张精灵图的功能
- 有无增加对 less 支持的计划? HOT 2
- 写了个粗糙的grunt-ispriter HOT 1
- background中有center和像素值时, 合并后像素值丢了
- 读取PNG文件不执行回调函数 HOT 3
- 图片定位会不正确 HOT 4
- 请问能否通过config配置单位 HOT 1
- 可以支持分组吗 HOT 1
- 支持retina屏 HOT 3
- 渐变色兼容
- 是否可以合并一个目录下的所有png图片,而不是从css中提取呢? HOT 1
- 输入的css文件要支持指定 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ispriter.