2

New to grunt, using grunt-contrib-imagemin to optimise my images. The default settings work great with PNG and save a lot. But there are barely any savings on jpegs. I'm trying to use an imagemin plugin to handle the jepg compression. I got mozjepg to work easy enough using this gruntfile - http://pastebin.com/z3eL3uZU[1]

The problem is that mozjepg still barely saves any kb from the pics. So I'm trying to find an imagemin plguin that really compresses jpegs.I have found these 2 and want to try them but cannot get them to work.

The first one is https://www.npmjs.com/package/imagemin-jpeg-recompress[2] and my gruntfile looks like this - http://pastebin.com/7cXTLYe7[3] - The CLI error is this

C:\Users\bmildren\Desktop\Sites\grunt-test>grunt imagemin:jpg
Running "imagemin:jpg" (imagemin) task
Fatal error: write EOF

C:\Users\bmildren\Desktop\Sites\grunt-test>

The same thing basically happens with this imagemin plugin too https://www.npmjs.com/package/imagemin-jpegoptim[4] Anyone know how to fix this?

mildrenben
  • 3,675
  • 5
  • 23
  • 37
  • I was having this same issue with the latest grunt-contrib-imagemin (0.9.2) so I went back to a previous version (0.8.1). This issue started to appear when I tried using imagemin-jpeg-recompress. I got it sorted out once I got the right grunt-contrib-imagemin version. I read somewhere on their repository that their package wasn't compatible with the newest imagemin. – CodeEngie Jan 23 '15 at 16:50

0 Answers0