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

imagemin-cli Example command doesn't work #340

Open
sebastiantf opened this issue Jan 8, 2020 · 5 comments
Open

imagemin-cli Example command doesn't work #340

sebastiantf opened this issue Jan 8, 2020 · 5 comments

Comments

@sebastiantf
Copy link

$ imagemin --plugin.webp.quality=95 --plugin.webp.preset=icon foo.png > foo-icon.webp

This example specified in the docs doesn't seem to work.

It produces the following error:

Unknown plugin: [object Object]

Did you forget to install the plugin?
You can install it with:

  $ npm install -g imagemin-[object Object]
@mattez
Copy link

mattez commented Apr 10, 2020

You want to use imagemin webp plugin so you should may be install it imagemin-webp plugin
Related issue is #260

@WangHansen
Copy link

I have a similar one:
$ imagemin p12.png --plugin.pngquant.quality={0.1,0.2} > ./images/p12.png

I got:

ArgumentError: (array `options.quality`) Expected `t` to be of type `number` but received type `string`

I believe it has something to do with imagemin-pngquant

@br4nnigan
Copy link

I have a similar one:
$ imagemin p12.png --plugin.pngquant.quality={0.1,0.2} > ./images/p12.png

I got:

ArgumentError: (array `options.quality`) Expected `t` to be of type `number` but received type `string`

Wow you actually got that far? I got:

> imagemin test.png --plugin.pngquant.quality={0.1,0.2} > test_opt.png
Unknown plugin: pngquant

And after installing the plugin I got this:

ArgumentError: Expected 'options.quality' to be of type 'array' but received type 'string'

Don't you love it when the most basic shit from the example already fails?

@MolotovCherry
Copy link

MolotovCherry commented Apr 13, 2021

I got this too. The basic example fails.
imagemin 1.png --plugin.pngquant.quality={0.1,0.2} > 1-test.png

ArgumentError: Expected `options.quality` to be of type `array` but received type `string`
    at u (...\nodejs\node_modules\imagemin-pngquant\node_modules\ow\dist\source\index.js:1:12174)
    at ...\nodejs\node_modules\imagemin-pngquant\index.js:35:3
    at ...\nodejs\node_modules\imagemin-cli\node_modules\p-pipe\index.js:12:25
    at handleFile (...\nodejs\node_modules\imagemin-cli\node_modules\imagemin\index.js:21:54)
    at async ...\nodejs\node_modules\imagemin-cli\node_modules\imagemin\index.js:54:13
    at async Promise.all (index 0)
    at async run (...\nodejs\node_modules\imagemin-cli\cli.js:90:11)
    at async ...\nodejs\node_modules\imagemin-cli\cli.js:122:3

If you take a hint from the error message and use --plugin.pngquant.options.quality={0.1,0.2}, then it works, HOWEVER if you play around with the setting, you'll soon realize that it isn't actually setting the quality and does NOTHING. --plugin=pngquant does just as much. It is broken. :/

@leesei
Copy link

leesei commented Jun 3, 2021

For "...but received type `string`" issue, see imagemin/imagemin-cli#28

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

No branches or pull requests

6 participants