imagemin / imagemin-pngquant

Imagemin plugin for `pngquant`
MIT License
316 stars 81 forks source link

Why it doesn't work? #45

Closed hackuun closed 6 years ago

hackuun commented 6 years ago

Hello. I have this code

.then(() => {
      imagemin([`./public/uploads/${'resize-' + req.body.file}`, `./public/uploads/${'greyscale-' + req.body.file}`], './public/uploads', {
        plugins: [
          mozjpeg({
            quality: 80,
            progressive: true
          }),
          pngquant({
            quality: '65-80'
          })
        ]
      })
    })

It comes after this

jimp.read(req.file.buffer)
    .then((file) => {
      file.resize(800, jimp.AUTO)
      file.write(`./public/uploads/${'resize-' + req.body.file}`)
      file.greyscale()
      file.write(`./public/uploads/${'greyscale-' + req.body.file}`)
    })

I don't know why pngquant doesn't work, because mozjpeg is working fine.

hackuun commented 6 years ago

I switched from jimp to sharp, now it's work. Probably not the imagemin issue anyway. Thanks for great package!

kevva commented 6 years ago

:+1: