1

I'm using Imagemin with Grunt, and have the following task setup in Gruntfile.js

imagemin: {
      options: {
        optimizationLevel: 5,
        progressive: true,
      },
      dev: {
        files: [{
         expand: true,
        cwd: 'src/img/',
        src: ['**/*.{png,jpg,gif}'],
        dest: 'app/minimg/'
      }]
   }
},

It looks like it is working because if I run "grunt imagemin", the output files is saved in the dest folder - and I get this message:

Running "imagemin:dev" (imagemin) task
Minified 13 images (saved 0 B)

But, why is the images not compressed ("saved 0 B") ? I have tried with a lot of different files both png and jpg. And it is always 0 B.

// Magnus

1 Answers1

0

Please try the latest version 'grunt-contrib-imagemin' . It Worked for me :)

//uninstalled the package. add -g flag if you've installed it globally.
npm uninstall grunt-contrib-imagemin --save-dev

//install again
npm install grunt-contrib-imagemin --save-dev
  • Thanks Vishnu. I had totally forget about this thread. Actually, I solved the problem a few weeks ago, by updating NPM to a later version then was installed along with Node. (I thought that updating Node also installed the latest version of NPM). – Magnus von Bromsen Mar 14 '15 at 17:58