imagemin-webp icon indicating copy to clipboard operation
imagemin-webp copied to clipboard

Not changing the .png or .jpg to .webp extension

Open matheusggds opened this issue 5 years ago • 5 comments

Is that a problem?

The images are smaller, but, will that image still work correctly?

gulp.task('images-min', () => {
	return gulp.src(paths.images)
		.pipe(imagemin([
			webp({
				lossless: true
			})
		]))
		.pipe(gulp.dest(`${paths.build}/images`));
});

matheusggds avatar May 28 '19 19:05 matheusggds

I can also confirm I'm having the same problem.

promise = imageMin([filePath], tmpdir ,{ use: [ imageMinWebP({quality: 80}) ] } )

is how I am calling it, and I am trying to convert a jpg to a webp, I instead get a .jpg path returned instead.

stot3 avatar May 29 '19 17:05 stot3

promise = imageMin([filePath], tmpdir ,{ plugins: [ imageMinWebP({quality: 80}) ] } )

also returns the same problem.

stot3 avatar May 29 '19 17:05 stot3

I'm facing the same problem with grunt... This is an issue, since I use imagemin to compress my images in both JPEG and WEBP to support all browsers, but the WEBP output overwrites the JPEG output.

Th3S4mur41 avatar Feb 18 '20 13:02 Th3S4mur41

same issue here, what's the deal?

kelly-tock avatar Oct 30 '20 12:10 kelly-tock

oh, I was using the node api,

async function main() {
  const files = await imagemin(['img/*.{jpg,png}'], {
    destination: 'webp',
    plugins: [
      webp({
        quality: 75, // Losslessly encode images
      }),
    ],
  });

  console.log(files);
}

main();

works.

kelly-tock avatar Oct 30 '20 12:10 kelly-tock