Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quality parameter doesen';t work #157

Open
Ihornechypor opened this issue Feb 15, 2023 · 0 comments
Open

quality parameter doesen';t work #157

Ihornechypor opened this issue Feb 15, 2023 · 0 comments

Comments

@Ihornechypor
Copy link

Ihornechypor commented Feb 15, 2023

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));
`

@Ihornechypor Ihornechypor changed the title Quliti paramert doesent work quality parameter doesen';t work Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant