Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gif图好像不能合 #21

Open
wangzhiwei1888 opened this issue Jan 9, 2014 · 5 comments
Open

gif图好像不能合 #21

wangzhiwei1888 opened this issue Jan 9, 2014 · 5 comments

Comments

@wangzhiwei1888
Copy link

gif图好像不能合,现在只能合并png图吗?

另外,如果合并单独几个图片为一张,命令应该怎么写呢。

@iazrael
Copy link
Owner

iazrael commented Jan 9, 2014

input.format 设置为 "png,gif"就能把png和gif一起合并了

@iazrael
Copy link
Owner

iazrael commented Jan 9, 2014

目前可以排除掉不想合并的图片, 可以使用通配符, 查看 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"],

@wangzhiwei1888
Copy link
Author

{
"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的文件。

@iazrael
Copy link
Owner

iazrael commented Jan 9, 2014

不好意思, 我刚刚测试了 gif, 目前 node-png 不支持读取gif图片, 所以还无法合并 gif, 我会在下个版本加上 gif支持

@wangzhiwei1888
Copy link
Author

期待...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants