grunt-image 4 doesn't work on local machine
Open, Needs TriagePublic


Starting with I0eaf94666a75feacbae2893a3cac2ab1e717a248 grunt-image doesn't work on my machine any more.
OOUI v0.24.0 was not affected by this error.

Options: optipng, pngquant, zopflipng, jpegRecompress=false, mozjpeg, guetzli=false, gifsicle, svgo, pngout, advpng, pngcrush
Warning: spawn /Users/…/htdocs/Wikimedia/oojs-ui/node_modules/pngquant-bin/vendor/pngquant ENOENT Use --force to continue.

npm v5.5.1
grunt-image 4.0.0

Tried removing node_modules, package-lock.json and reinstalling. Didn't solve the issue.

Volker_E created this task.Nov 7 2017, 10:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 7 2017, 10:45 PM
Volker_E closed this task as Invalid.Dec 14 2017, 8:05 AM

@Jdforrester-WMF Whatever it was, it must have been one of the following:

  • updating npm to v5.6.0
  • updating Homebrew to latest, v1.4.0
  • composer update
  • removing package-lock.json
  • removing node_modules
  • npm install

grunt image works now and svg2png works as well.

…aaaand grunt image doesn't work again. :(

spawn /Users/.../htdocs/Wikimedia/oojs-ui/node_modules/pngquant-bin/vendor/pngquant EAGAIN

Volker_E reopened this task as Open.Wed, Dec 20, 11:15 PM

It doesn't work for me either, with a different error:

Warning: Command failed: F:\mediawiki\oojs\ui\node_modules\grunt-image\node_modules\zopflipng-bin\vendor\zopflipng.exe -y --lossy_8bit --lossy_transparent C:\Users\a\AppData\Local\Temp\fefdda57-44b5-4b6d-983f-c92b0efa20b7 C:\Users\a\AppData\Local\Temp\91b0bd99-a542-4a41-810f-aaf9f32967ac

Optimizing C:\Users\a\AppData\Local\Temp\fefdda57-44b5-4b6d-983f-c92b0efa20b7
Encoding error 82: color conversion to palette requested while a color isn't in palette
Decoding error 82: color conversion to palette requested while a color isn't in palette
There was an error

Can we just get rid of this library? We barely use the PNGs generated here in WMF production (only the checkbox I think, all normal icons go through ResourceLoaderImageModule instead).

Change 400269 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] build: Stop using 'grunt-image' for optimizing PNGs

Change 400269 abandoned by Bartosz Dziewoński:
build: Stop using 'grunt-image' for optimizing PNGs