0

My imagemin doesn't seem to compress jpgs? It says: "37 images found. Saved 0 B.

Weirdly enough it works on .gif and .png so I know it's working to some degree. Anyone else had this problem?

I've tried uninstalling/re-installing. Also got the latest version: 0.9.4.

Here's my code:

imagemin: {
  dynamic: {
    options: {
      optimizationLevel: 3
    },
    files: [{
      expand: true,
      cwd: 'imgs-src/',
      src: ['**/*.{png,jpg,gif}'],
      dest: 'imgs/'
    }]
  }
}

Thanks!

Rhys
  • 489
  • 3
  • 14

1 Answers1

0

As per the plugin documentation,Options will only apply to the relevant files within your src.

The option that you provided is optimizationLevel and its value 3, Which is applicable for only png images and not for other formats.

optimizationLevel (png)

progressive (jpg)

interlaced (gif)

svgoPlugins (svg)

you need to use

progressive:true

within your code for enabling compression of jpgs.

Abhijeet Kamble
  • 3,131
  • 2
  • 30
  • 36
  • Hey mate! Just read the docs again however "progressive" is true by default, there's no need to have it in the code for it to work with jpg's. – Rhys Aug 28 '15 at 03:51