mahnunchik / gulp-responsive

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

Wrong extension - extname ignored (jpeg instead of jpg) #136

Open krisdante opened 4 years ago

krisdante commented 4 years ago

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.

robinloeffel commented 4 years ago

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

m90 commented 4 years ago

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