twolfson/grunt-spritesmith

Combination of Phantom and not specifying algorithm causes 0 size png to be generated

Open

#47 opened on Nov 11, 2013

View on GitHub
 (30 comments) (0 reactions) (0 assignees)JavaScript (98 forks)batch import
bughelp wanted

Repository metrics

Stars
 (1,141 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Firstly, thanks for an awesome grunt plugin. I had some issues today using this for the first time on Windows with Phantom. I was seeing that the css was generated fine, but the png had zero file size. My task looked like:

classes_sp : {
   src : '<%= css_src_path %>/classes/**/*.png',
   destImg : '<%= css_build_path %>/classes-sprite.png',
   destCSS : '<%= css_build_path %>/classes-sprite.css',
   'engine' : 'phantomjs'
},

By adding in the algorithm as binary-tree, rather than using the default, all of a sudden png files and css generated correctly. Admittedly the sprites were fairly large one 5Mb and one 70Mb (152 images) - which is ridiculous but I was just trying to get something working.

I think if it is related to the size an error stating that files were too large to sprite with the algorithm would be cool - a silent fail makes me a bit nervous to use this in production.

Contributor guide