twolfson/grunt-spritesmith

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

Open

#47 aperta il 11 nov 2013

Vedi su GitHub
 (30 commenti) (0 reazioni) (0 assegnatari)JavaScript (98 fork)batch import
bughelp wanted

Metriche repository

Star
 (1141 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor