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

joepagan opened this Issue Oct 5, 2016 · 1 comment


None yet
1 participant

joepagan commented Oct 5, 2016


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

[22:01:45] Using gulpfile ~/Documents/sites/
[22:01:45] Starting 'minify-pngs'...
      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 (
Mac port assistance by Jonathon Fowler (
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/
    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})())

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?


This comment has been minimized.

joepagan commented Oct 6, 2016

According to this post the imagemin options "use" and "plugins" are now obsolete, and the correct way to use plugins with it is like this:

        strategy: 1

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

    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/
    at DestroyableTransform.through.obj (/Users/username/sites/
    at DestroyableTransform._transform (/Users/username/sites/
    at DestroyableTransform.Transform._read (/Users/username/sites/
    at DestroyableTransform.Transform._write (/Users/username/sites/
    at doWrite (/Users/username/sites/
    at writeOrBuffer (/Users/username/sites/
    at DestroyableTransform.Writable.write (/Users/username/sites/
    at write (/Users/username/sites/
    at flow (/Users/username/sites/ username$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment