davidtheclark / grunt-spritesmith-hd Goto Github PK
View Code? Open in Web Editor NEWAn adaptation of grunt-spritesmith to produce hd-ready sprites
License: Other
An adaptation of grunt-spritesmith to produce hd-ready sprites
License: Other
To address the problems raised here: #6 (comment)
It would be nice if the mustache template could be customized (i.e. some config option?), a little fix that I suggest (if this does not break anything) is to change the "${{name}}" variable build like this:
${{name}}: ${{name}}-x ${{name}}-y ${{name}}-offset-x ${{name}}-offset-y ${{name}}-width ${{name}}-height ${{name}}-total-width ${{name}}-total-height ${{name}}-image ${{name}}-hd;
This can be useful if some adjustments (such as custom positions or width, etc.) are required before CSS sprite is built.
Thanks for your job ;)
My bests,
-- Valerio
Hi, each time I run the task with the hd option not specified I get this error. If hd is set to false I don't get the error.
Here's the verbose output from grunt:
Running "spriteHD" task
Running "spriteHD:mainPage" (spriteHD) task
Verifying property spriteHD.mainPage exists in config...OK
Files: Source/site/templates/img/tile/st-logo-large.png, Source/site/templates/img/tile/st- logo-small.png
Options: engine="auto", destImg="Source/site/templates/img/sprites", destCSS="Source/site/templates/css/sass/sprites", imgUrl="/site/templates/img/sprites"
Creating temporary hd assets ...
Reading Source/site/templates/img/tile/st-logo-large.png...OK
Writing tempAssets/hd-main-assets/hd-st-logo-large.png...OK
Reading Source/site/templates/img/tile/st-logo-small.png...OK
Writing tempAssets/hd-main-assets/hd-st-logo-small.png...OK
Creating temporary ld assets ...
Fatal error: Property 'log' of object #<Object> is not a function
If I then run the task again, I get:
An existing directory is getting in the way of spritesmithHD creating a temporary LD asset directory at 'tempAssets/ld-main-assets'.
Since v3.0.1 this option doesn't work.
And maybe then ditch the GraphicsMagick dependency?
Avoiding the apparent failures with just adjusting background position
Can't pass "true" and "false" with current configuration.
Change line 171 to:
coordinate.image = imgUrl + '/' + baseSpritesheet;
line 183 to:
"hdSpritesheetPath": imgUrl + '/' + hdSpritesheetName
Otherwise node's path will remove the double "//"
Error in grunt:
http://grabilla.com/05206-61966a8f-68d5-4d75-a7f8-b3dd959875c1.png
My grunt code:
http://grabilla.com/05206-1835735c-4c78-4f6c-8a38-d6387caa5618.png
It looks like it tried to switch to using the gm engine instead of the im engine for some reason :/
I've installed both engines on my computer now though and I'm still getting that message :(
I tried going doing the resizing with the gm engine and it's still not working for me :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.