Использую плагины: gulp-imagemin, imagemin-webp, gulp-ext-replace.
Функция такая:
function converter(done){
gulp.src('./dev/img/*')
.pipe(imagemin([
webp({
quality: 75
})
]))
.pipe(extReplace(".webp"))
.pipe(gulp.dest('./public/img/desktop/webp23/'));
done();
}
gulp.task('default', converter);
Но выдает почему то, такую ошибку:
(node:2784) UnhandledPromiseRejectionWarning: Error: CoCreateInstance(MAKE_REFGUID(CLSID_WICImagingFactory), NULL, CLSCTX_INPROC_SERVER, MAKE_REFGUID(IID_IWICImagingFactory), (LPVOID*)&factory) failed 80040154
Couldn't access Windows Imaging Component (are you running Windows XP SP3 or newer?). Most formats not available. Use -s for the available YUV input.
Decoding of input data failed.
Status: 3(BITSTREAM_ERROR)
Error! Could not process file C:\Users\9874~1\AppData\Local\Temp\a8bd2846-adf4-4fdb-b1e6-838fd5ffc8c9
Error! Cannot read input picture file 'C:\Users\9874~1\AppData\Local\Temp\a8bd2846-adf4-4fdb-b1e6-838fd5ffc8c9'
at Promise.all.then.arr (C:\Users\Темирлан\Desktop\Конвертатор на галпе\node_modules\execa\index.js:231:11)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2784) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:2784) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.