gulp-responsive icon indicating copy to clipboard operation
gulp-responsive copied to clipboard

Wrong extension - extname ignored (jpeg instead of jpg)

Open krisdante opened this issue 5 years ago • 2 comments

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.

krisdante avatar Dec 12 '19 22:12 krisdante

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

robinloeffel avatar Feb 18 '20 12:02 robinloeffel

I "fixed" this by locking my package version to 2.7.0 which still keeps the correct file extensions.

m90 avatar Feb 21 '20 18:02 m90