mahnunchik / gulp-responsive

gulp-responsive generates images at different sizes
https://npmjs.com/gulp-responsive
MIT License
503 stars 60 forks source link

quality parameter doesen';t work #157

Open Ihornechypor opened 1 year ago

Ihornechypor commented 1 year ago

Hello, maybe someone has an issue with image optimization. I've tried different parameters but still have the same result. And after conversion tinypng can optimize images with -70% result.

`const { src, dest, parallel, series, } = require('gulp');

const responsive = require("gulp-responsive"); const clean = require('gulp-clean');

const delDist = () => src('dist/*/', {read: false}).pipe(clean())

const respImages = () => { return src('src//*.{jpg,png}') .pipe( responsive({ '*/.jpg': [{ width: "5%", blur: 1.2, quality: 50, rename: { suffix: '-ph' }, format: ['webp'] }, { width: "100%", quality: 50, rename: { suffix: '@2x' }, format: ['webp', 'jpg'] }, { width: "50%", quality: 50, quality: 75, format: ['webp', 'jpg'] }], '/*.png': [{ width: "5%", quality: 50, blur: 1.2, rename: { suffix: '-ph' }, format: ['webp'] }, { width: "100%", quality: 50, rename: { suffix: '@2x' }, format: ['webp', 'png'] }, { width: "50%", quality: 50, format: ['webp', 'png'] }] }, { errorOnEnlargement: false, skipOnEnlargement: true, errorOnUnusedConfig: false, errorOnUnusedImage: false }) ) .pipe(dest('dist')); };

exports.default = series(delDist, parallel(respImages)); `