dbushell / grunt-svg2png

Grunt plugin to rasterize SVG to PNG images using PhantomJS
MIT License
76 stars 37 forks source link

`spawn ENAMETOOLONG` when trying to process too many files or files with long pathes #17

Closed paulradzkov closed 9 years ago

paulradzkov commented 10 years ago

I've got an error Fatal error: spawn ENAMETOOLONG when was tying to process too many files or files has too long pathes.

My config:

        svg2png:
            icons:
                files: [
                    expand: false,
                    cwd: 'src/files/icons/svg/',
                    src: ['*.svg'],
                    dest: 'src/files/icons/png/',
                ]

svg2png-error

Could you investigate please?

MatmaRex commented 9 years ago

I have also hit this, in a project with 293 files.

The problem is that this tool passes the list of files (as a JSON blobl) to phantomjs as a command-line parameter, and clearly when you have more than a couple thousand characters the thing blows up.

Instead, we can pass it via a pipe to the standard input. I have a patch for this, submitting a pull request shortly.