Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp errors #2

Closed
joepagan opened this issue Oct 5, 2016 · 1 comment · Fixed by #3
Closed

gulp errors #2

joepagan opened this issue Oct 5, 2016 · 1 comment · Fixed by #3

Comments

@joepagan
Copy link

joepagan commented Oct 5, 2016

Hey,

I'm trying to use this with gulp, but I seems to get this error:

[22:01:45] Using gulpfile ~/Documents/sites/website.com/gulpfile.js
[22:01:45] Starting 'minify-pngs'...
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: Too many filenames specified on cmdline
PNGOUT [In:{PNG,JPG,GIF,TGA,PCX,BMP}] (Out:PNG) (options...)        Feb 21 2013
by Ken Silverman (http://advsys.net/ken)
Mac port assistance by Jonathon Fowler (http://www.jonof.id.au/pngout)
PNGOUT optimizes PNG size losslessly using my own deflate algorithm (not Zlib)
With the right options, it can often beat other programs by 5-10%. Options:
   -c# PNG output color: 0=Gray, 2=RGB, 3=Pal, 4=Gray+Alpha, 6=RGB+Alpha
   -f# PNG output filter: 0=none, 1=�x, 2=�y, 3=�x&y, 4=Paeth, 5=mixed, 6=reuse
   -d# Override default bitdepth: 0(min),1,2,4,8 (valid only in /c0,/c3 modes)
   -s# Select strategy. 0:Xtreme(default), 1:Intense, 2:Longest Match,
       3:Huffman Only, 4:Uncompressed
   -b# Block split threshold (lower=more blocks, 0=1 block/file, default=256)
       Use trial&error! Suggested values to try are: 0,128,192,256,512,1024,..
   -n# Exact number of Huffman blocks (overrides /b#)
   -r  Randomized initial tables (good for many trials with same options)
   -k? 0=Remove optional chunks (default), 1=Keep all
       p=Keep palette indices, s=Keep settings for /c,f,d,b
   -k(Chunk,Chunk,..) Preserve only named chunk(s). Example: -kgAMA,bKGD,tEXt
   -v,q,l Verbose,Quiet,List mode (use '-' as filename to specify stdin/stdout)
   -y  Assume Yes at the 'overwrite file?' prompt
   -force  Write file even if bigger.
   -mincodes#  Workaround for buggy decoders. 1:Zlib 1.2.1 bug, 2:buggy mobiles
The 1st filename is the input. If you omit the output
filename, PNGOUT will use the same filename with a .PNG extension. Examples:
   $ pngout inlarge.bmp outsmall.png           <- writes outsmall.png
   $ pngout duke3d.png -c2 -f3 -b128 -kbKGD -v <- writes duke3d.png if smaller

    at ChildProcess.<anonymous> (/Users/username/Documents/sites/website.com/node_modules/imagemin-pngout/index.js:60:8)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

Here is an example of my gulpfile tasks:

gulp.task("minify-pngs", function(){
    return gulp.src(paths.images+"/**/*.png")
    .pipe(imageminPngout({strategy: 1})())
    .pipe(gulp.dest("./images"));
});

As you can see it seems to suggest there are "Too many filenames specified on cmdline", but, the files at the destination paths.images+"/**/*.png" there are only 2 files, 1 jpg and 1 png.

Do you know if there is anything I can do?

@joepagan
Copy link
Author

joepagan commented Oct 6, 2016

According to this post http://stackoverflow.com/questions/38001293/gulp-imagemin-not-using-plugins-option the imagemin options "use" and "plugins" are now obsolete, and the correct way to use plugins with it is like this:

.pipe(imagemin([
    imageminPngout({
        strategy: 1
    })
]))

But I still get a bunch of errors with this method:

/Users/username/sites/website.com/node_modules/imagemin/index.js:66
    return pipe.then(buf => buf.length < input.length ? buf : input);
                ^

TypeError: pipe.then is not a function
    at Function.module.exports.buffer (/Users/username/sites/website.com/node_modules/imagemin/index.js:66:14)
    at DestroyableTransform.through.obj (/Users/username/sites/website.com/node_modules/gulp-imagemin/index.js:58:12)
    at DestroyableTransform._transform (/Users/username/sites/website.com/node_modules/through2-concurrent/through2-concurrent.js:30:15)
    at DestroyableTransform.Transform._read (/Users/username/sites/website.com/node_modules/through2-concurrent/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/Users/username/sites/website.com/node_modules/through2-concurrent/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (/Users/username/sites/website.com/node_modules/through2-concurrent/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/Users/username/sites/website.com/node_modules/through2-concurrent/node_modules/readable-stream/lib/_stream_writable.js:302:5)
    at DestroyableTransform.Writable.write (/Users/username/sites/website.com/node_modules/through2-concurrent/node_modules/readable-stream/lib/_stream_writable.js:241:11)
    at write (/Users/username/sites/website.com/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Users/username/sites/website.com/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
Joes-iMac:website.com username$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant