imagemin-webp
imagemin-webp copied to clipboard
Not changing the .png or .jpg to .webp extension
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`));
});
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.
promise = imageMin([filePath], tmpdir ,{ plugins: [ imageMinWebP({quality: 80}) ] } )
also returns the same problem.
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.
same issue here, what's the deal?
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.