Open MatthiasKuehneEllerhold opened 3 months ago
Updating to gulp v5 all my worflows with gulp-scale-images were broken: "Error: Input buffer contains unsupported image format"
gulp-scale-images
There was only one result in google for this error, but this pointed towards a problem with svgs and sharp.
Gulp v5 changed the default encoding of all of their streams to UTF-8. gulp-scale-images does not seem aware of this and expects a binary stream?
What you have to do is set encoding to false on your streams.
false
return gulp // Load file .src(data.source, {encoding: false}) // We want to have multiple sizes per source image .pipe(flatMap.default(variantsPerFile)) // Scale the images .pipe(scaleImages(computeFileName)) // Write result file .pipe(gulp.dest(application.destinationPath + '/' + key));
With this change my workflow are once again working correctly.
Can you either add this to the README or somehow fix this in code?
PR welcome!
Updating to gulp v5 all my worflows with
gulp-scale-images
were broken: "Error: Input buffer contains unsupported image format"There was only one result in google for this error, but this pointed towards a problem with svgs and sharp.
Gulp v5 changed the default encoding of all of their streams to UTF-8.
gulp-scale-images
does not seem aware of this and expects a binary stream?What you have to do is set encoding to
false
on your streams.With this change my workflow are once again working correctly.
Can you either add this to the README or somehow fix this in code?