1000ch / gulp-image

Optimize PNG, JPEG, GIF, SVG images with gulp task.
http://bit.ly/we-should-optimize-images
MIT License
222 stars 22 forks source link

it doesn't compress #18

Closed JaBERx closed 7 years ago

JaBERx commented 8 years ago

Hi,

This error shows up when i try to compress an image: off.png

Any help!?

Thanks,

`{ [Error: Command failed: /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/zopflipng-bin/vendor/zopflipng -y --lossy_8bit --lossy_transparent /var/folders/h0/jl9h196n3q91zv534jt_w8t00000gn/T/3053d46d-ed88-487f-8711-094502d1e9ce /var/folders/h0/jl9h196n3q91zv534jt_w8t00000gn/T/9ea95c5b-d873-41cc-b193-6b97aa4e1e5b Optimizing /var/folders/h0/jl9h196n3q91zv534jt_w8t00000gn/T/3053d46d-ed88-487f-8711-094502d1e9ce 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

] killed: false, code: 1, signal: null, cmd: '/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/zopflipng-bin/vendor/zopflipng -y --lossy_8bit --lossy_transparent /var/folders/h0/jl9h196n3q91zv534jt_w8t00000gn/T/3053d46d-ed88-487f-8711-094502d1e9ce /var/folders/h0/jl9h196n3q91zv534jt_w8t00000gn/T/9ea95c5b-d873-41cc-b193-6b97aa4e1e5b', stdout: 'Optimizing /var/folders/h0/jl9h196n3q91zv534jt_w8t00000gn/T/3053d46d-ed88-487f-8711-094502d1e9ce\nEncoding error 82: color conversion to palette requested while a color isn\'t in palette\nDecoding error 82: color conversion to palette requested while a color isn\'t in palette\nThere was an error\n\n', stderr: '' }`

JaBERx commented 8 years ago

After trying to re-install,

Some of the dependencies doesn't pass through the installation,

jpeg-recompress-bin@3.0.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpeg-recompress-bin

node lib/install.js

✔ jpeg-recompress pre-build test passed successfully

jpegoptim-bin@3.0.0 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpegoptim-bin node lib/install.js

⚠ The /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpegoptim-bin/vendor/jpegoptim binary doesn't seem to work correctly ⚠ jpegoptim pre-build test failed ℹ compiling from source ✖ Error: ./configure --prefix="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpegoptim-bin/vendor" --bindir="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpegoptim-bin/vendor" && make install Command failed: /bin/sh -c ./configure --prefix="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpegoptim-bin/vendor" --bindir="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpegoptim-bin/vendor"

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827: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:486:12)

zopflipng-bin@3.0.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/zopflipng-bin node lib/install.js

✔ zopflipng pre-build test passed successfully

optipng-bin@3.1.2 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/optipng-bin node lib/install.js

✔ optipng pre-build test passed successfully

gifsicle@3.0.3 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/gifsicle node lib/install.js

✔ gifsicle pre-build test passed successfully

pngquant-bin@3.1.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/pngquant-bin node lib/install.js

✔ pngquant pre-build test passed successfully

mozjpeg@4.1.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg node lib/install.js

⚠ The /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor/cjpeg binary doesn't seem to work correctly ⚠ mozjpeg pre-build test failed ℹ compiling from source ✖ Error: autoreconf -fiv && ./configure --disable-shared --prefix="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor" --bindir="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor" --libdir="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor" && make --jobs=4 && make install --jobs=4 Command failed: /bin/sh -c autoreconf -fiv /bin/sh: autoreconf: command not found

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827: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:486:12)
1000ch commented 8 years ago

@JaBERx Try re-install again after brew install libjpeg?

JaBERx commented 8 years ago

@1000ch i did brew install libjpeg, and re-installed the gulp-image again, it takes around 60 seconds to install, no jpegoptim error anymore, but mozjpeg didn't fixed it

npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain, use it instead! |

jpegoptim-bin@3.0.0 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpegoptim-bin node lib/install.js

✔ jpegoptim pre-build test passed successfully

zopflipng-bin@3.0.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/zopflipng-bin node lib/install.js

✔ zopflipng pre-build test passed successfully

jpeg-recompress-bin@3.0.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/jpeg-recompress-bin node lib/install.js

✔ jpeg-recompress pre-build test passed successfully

gifsicle@3.0.3 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/gifsicle node lib/install.js

✔ gifsicle pre-build test passed successfully

mozjpeg@4.1.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg node lib/install.js

⚠ The /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor/cjpeg binary doesn't seem to work correctly ⚠ mozjpeg pre-build test failed ℹ compiling from source ✖ Error: autoreconf -fiv && ./configure --disable-shared --prefix="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor" --bindir="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor" --libdir="/Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/mozjpeg/vendor" && make --jobs=4 && make install --jobs=4 Command failed: /bin/sh -c autoreconf -fiv /bin/sh: autoreconf: command not found

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827: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:486:12)

optipng-bin@3.1.2 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/optipng-bin node lib/install.js

✔ optipng pre-build test passed successfully

pngquant-bin@3.1.1 postinstall /Users/jabersalehi/Dropbox/doctor-lebas/admin/node_modules/gulp-image/node_modules/pngquant-bin node lib/install.js

✔ pngquant pre-build test passed successfully gulp-image@2.3.0 ../node_modules/gulp-image ├── is-jpg@1.0.0 ├── is-png@1.0.0 ├── is-gif@1.0.0 ├── filesize@3.3.0 ├── map-stream@0.1.0 ├── is-svg@2.0.1 (html-comment-regex@1.1.1) ├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, strip-ansi@3.0.1, has-ansi@2.0.0) ├── execa@0.4.0 (path-key@1.0.0, strip-eof@1.0.0, npm-run-path@1.0.0, is-stream@1.1.0, object-assign@4.1.0, cross-spawn-async@2.2.4) ├── exec-buffer@3.0.0 (pify@2.3.0, tempfile@1.1.1, execa@0.3.0) ├── gulp-util@3.0.7 (array-differ@1.0.0, lodash._reevaluate@3.0.0, beeper@1.1.0, lodash._reinterpolate@3.0.0, lodash._reescape@3.0.0, array-uniq@1.0.3, object-assign@3.0.0, replace-ext@0.0.1, minimist@1.2.0, has-gulplog@0.1.0, fancy-log@1.2.0, vinyl@0.5.3, gulplog@1.0.0, lodash.template@3.6.2, through2@2.0.1, multipipe@0.1.2, dateformat@1.0.12) ├── svgo@0.6.6 (sax@1.2.1, whet.extend@0.9.9, coa@1.0.1, mkdirp@0.5.1, csso@2.0.0, js-yaml@3.6.1) ├── jpegoptim-bin@3.0.0 (logalot@2.1.0, bin-build@2.2.0, bin-wrapper@3.0.2) ├── zopflipng-bin@3.0.1 (logalot@2.1.0, bin-wrapper@3.0.2, bin-build@2.2.0) ├── jpeg-recompress-bin@3.0.1 (logalot@2.1.0, bin-wrapper@3.0.2) ├── gifsicle@3.0.3 (logalot@2.1.0, bin-build@2.2.0, bin-wrapper@3.0.2) ├── mozjpeg@4.1.1 (logalot@2.1.0, bin-wrapper@3.0.2, bin-build@2.2.0) ├── optipng-bin@3.1.2 (logalot@2.1.0, bin-wrapper@3.0.2, bin-build@2.2.0) └── pngquant-bin@3.1.1 (logalot@2.1.0, bin-wrapper@3.0.2, bin-build@2.2.0)

I also tried brew install mozjpeg , and re-installed gulp-image, but same error.

1000ch commented 8 years ago

@JaBERx Again after brew install libjpeg-turbo? Check this instruction, too https://github.com/mozilla/mozjpeg/blob/master/BUILDING.md.

JaBERx commented 8 years ago

@1000ch tried again after brew install libjpeg-turbo, same error again, I actually couldn't spend much time on the mozjpeg BUILDING.md, unfortunately I'll have to uninstall this package for now, because this is a shared repository, it might cause problem in our workflow, because we need to compress images before build,

I don't know why this happened, it was working fine... I'll try again in next week, I hope you fix it, Thanks for the time.

maxmilton commented 8 years ago

I also have jpegoptim failing to build on my system (Linux, Fedora 24 x86_64):

> jpegoptim-bin@3.0.0 postinstall /home/max/Development/maxmilton.com/themes/mm/node_modules/jpegoptim-bin
> node lib/install.js

  ⚠ The `/home/max/Development/maxmilton.com/themes/mm/node_modules/jpegoptim-bin/vendor/jpegoptim` binary doesn't seem to work correctly
  ⚠ jpegoptim pre-build test failed
  ℹ compiling from source
  ✖ Error: ./configure --prefix="/home/max/Development/maxmilton.com/themes/mm/node_modules/jpegoptim-bin/vendor" --bindir="/home/max/Development/maxmilton.com/themes/mm/node_modules/jpegoptim-bin/vendor" && make install
Command failed: ./configure --prefix="/home/max/Development/maxmilton.com/themes/mm/node_modules/jpegoptim-bin/vendor" --bindir="/home/max/Development/maxmilton.com/themes/mm/node_modules/jpegoptim-bin/vendor"

    at ChildProcess.exithandler (child_process.js:206:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

I'm disabling it via jpegoptim: false for now.

alexpryshchepa commented 7 years ago

zopflipng: false

1000ch commented 7 years ago

Move to #30 🏃