akoenig / gulp-svg2png

A gulp plugin for converting SVGs to PNGs.
MIT License
54 stars 34 forks source link

Getting an error when trying to run gulp-svg2png #2

Closed davidturner closed 10 years ago

davidturner commented 10 years ago

I’m in the process of trying to switch my grunt workflow to a gulp one, but I’ve run into an issue when running the svg2png process. I’ve tried it inside of my own workflow, but also when I clone the repo.

When I clone the repo down, and run npm install everything installs fine. When I then run the gulp command the following occurs:

[gulp] Using file /Users/davidturner/Desktop/gulp-svg2png-master/gulpfile.js
[gulp] Working directory changed to /Users/davidturner/Desktop/gulp-svg2png-master
[gulp] Running 'lint'...
[gulp] Finished 'lint' in 6.43 ms
[gulp] Running 'test'...
[gulp] Finished 'test' in 12 ms
[gulp] Running 'default'...
[gulp] Finished 'default' in 7.37 μs

/Users/davidturner/Desktop/gulp-svg2png-master/index.js:45
        throw new gutil.PluginError(PLUGIN_NAME, message);
              ^
[gulp] Error in plugin 'gulp-svg2png': Error while converting image.Error: 2014-02-13 10:17:09.758 phantomjs[49875:507] ApplePersistence=NO
    at error (/Users/davidturner/Desktop/gulp-svg2png-master/index.js:45:15)
    at converted (/Users/davidturner/Desktop/gulp-svg2png-master/index.js:115:24)
    at /Users/davidturner/Desktop/gulp-svg2png-master/node_modules/svg2png/lib/svg2png.js:22:13
    at ChildProcess.exithandler (child_process.js:635:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

I’ve not done anything past cloning the repo down and installing the modules, so it may be that I’ve missed something out. Any help would be greatly appreciated.

akoenig commented 10 years ago

Hej,

hm, strange. Which version of gulp and Node.js do you use?

/André

davidturner commented 10 years ago

Node: v0.10.25 Gulp: CLI version 3.5.2

Running on a MBP running OS X 10.9.1, in case that helps.

akoenig commented 10 years ago

@davidturner Does this problem still persists?

davidturner commented 10 years ago

@akoenig It looks like the issue is still there for me, though the line numbers involved have changed slightly. The error output I’m getting now is:

/Users/davidturner/Server/gulp-invited-dev/node_modules/gulp-svg2png/index.js:53
        throw new gutil.PluginError(PLUGIN_NAME, message);
              ^
[gulp] Error in plugin 'gulp-svg2png': Error while converting image.Error: 2014-04-04 18:32:04.484 phantomjs[16191:507] ApplePersistence=NO
    at error (/Users/davidturner/Server/gulp-invited-dev/node_modules/gulp-svg2png/index.js:53:15)
    at converted (/Users/davidturner/Server/gulp-invited-dev/node_modules/gulp-svg2png/index.js:139:24)
    at /Users/davidturner/Server/gulp-invited-dev/node_modules/gulp-svg2png/node_modules/svg2png/lib/svg2png.js:22:13
    at ChildProcess.exithandler (child_process.js:635:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
akoenig commented 10 years ago

Really strange. Can't reproduce it :/

nelsonpecora commented 10 years ago

Getting this too: http://cl.ly/image/1b293c1A2z0o

node v0.10.24
gulp v3.6.2

Here are the relevant parts of my gulpfile:

gulp = require 'gulp'
imagemin = require 'gulp-imagemin'
svg2png = require 'gulp-svg2png'

# build icons
gulp.task 'icons', ->
    gulp.src 'wp-content/themes/bolster2/icons/*'
        .pipe imagemin { svgoPlugins: [{ removeViewBox: true }] }
        .pipe gulp.dest 'build/icons'
        .pipe svg2png()
        .pipe gulp.dest 'build/icons/png'

EDIT: It doesn't work, even if I remove the imagemin stuff.

thomaswelton commented 10 years ago

Also hitting this problem

[gulp] Error in plugin 'gulp-svg2png': Error while converting image.Error: 2014-05-21 15:01:26.181 phantomjs[50762:507] In 'CFPasteboardCopyDataReturn __CFPasteboardCopyData(CFPasteboardRef, CFIndex, CFIndex, CFStringRef, Boolean, Boolean)', file /SourceCache/CF/CF-855.16/AppServices.subproj/CFPasteboard.c, line 2953, during unlock, spin lock 0x10af004c8 has value 0x0, which is not locked.  The memory has been smashed or the lock is being unlocked when not locked.
    at error (/Users/thomas/moo/toolkit/node_modules/gulp-svg2png/index.js:53:15)
    at converted (/Users/thomas/moo/toolkit/node_modules/gulp-svg2png/index.js:139:24)
    at /Users/thomas/moo/toolkit/node_modules/gulp-svg2png/node_modules/svg2png/lib/svg2png.js:22:13
    at ChildProcess.exithandler (child_process.js:645:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:753:16)
    at Socket.<anonymous> (child_process.js:966:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
nelsonpecora commented 10 years ago

@thomaswelton what are the filenames of your svgs? I hit this issue when I had # in the name, since it messed up phantomjs (it interprets it as a url fragment, which makes sense).

thomaswelton commented 10 years ago

nothing special in the names. Thanks for your reply by I swapped to use gulp-raster which works just fine

christianhaller commented 10 years ago

I have the same error

[11:14:53] Using gulpfile ~/g+j/stern-sprite/gulpfile.js
[11:14:53] Starting 'fallback'...

/Users/halle3/g+j/stern-sprite/node_modules/gulp-svg2png/index.js:59
    throw new gutil.PluginError(PLUGIN_NAME, message);
          ^
Error in plugin 'gulp-svg2png'
Error while converting image.Error: 2014-08-14 11:14:59.149 phantomjs[12610:507] ApplePersistence=YES
at error (/Users/halle3/g+j/stern-sprite/node_modules/gulp-svg2png/index.js:59:15)
at converted (/Users/halle3/g+j/stern-sprite/node_modules/gulp-svg2png/index.js:160:24)
at /Users/halle3/g+j/stern-sprite/node_modules/gulp-svg2png/node_modules/svg2png/lib/svg2png.js:22:13
at ChildProcess.exithandler (child_process.js:645:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)

node -v v0.10.29 gulp -v CLI version 3.8.5 Local version 3.8.7

OSX

christianhaller commented 10 years ago

phantomjs --version 1.9.7