sitilge February 2016

Gulp image optimization breaks images

Using the gulp-image-optimization plugin. The plugin outputs, that the images are optimized; however they appear to be broken/empty after the script runs. A snippet of the gulpfile.js

gulp.task('img', function(cb) {
gulp.src(['public/img/**/*.png', 'public/img/**/*.jpg', 'public/img/**/*.jpeg', 'public/img/**/*.gif'])
    .pipe(imgOptimize({
        optimizationLevel: 5,
        progressive: true,
        interlaced: true
    }))
    .pipe(gulp.dest('public/img'))
    .on('end', cb)
    .on('error', cb);
});

Can anyone explain to me why it happens?

Answers


eburger February 2016

According to the gulp blacklist, you should use gulp-imagemin instead.

Post Status

Asked in February 2016
Viewed 1,328 times
Voted 4
Answered 1 times

Search




Leave an answer