gulp-responsive
gulp-responsive copied to clipboard
Wrong extension - extname ignored (jpeg instead of jpg)
This is my config:
return gulp.src('static-full/team/*.{jpg,png}')
.pipe(responsive({
'*': [
{
width: 480,
rename: {
extname: '.jpg',
},
quality: 80,
format: 'jpeg'
},
{
width: 480,
rename: {
extname: '.webp',
},
format: 'webp'
}
],
}
Extname is '.jpg' but when I execute it files are name .jpeg not .jpg It seems that extreme is ignored.
Since this project seems to be inactive (https://github.com/mahnunchik/gulp-responsive/issues/111), I've gone ahead and created a new plugin for the purpose of resizing your images: https://github.com/robinloeffel/gulp-rezzy.
You can use gulp-rezzy
together with gulp-webp
(and gulp-imagemin
) to achieve your goal. Pipe your assets to gulp-rezzy
, then gulp-imagemin
, then write the stream (your jpg images) to the disk, pipe them to gulp-webp
and at the end write stream (your webp images) to the disk again.
Edit: This is exactly what I do here, actually: https://github.com/robinloeffel/swissplant/blob/master/gulpfile.js#L89
I "fixed" this by locking my package version to 2.7.0
which still keeps the correct file extensions.