-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with gulp 5.0.0 #159
Comments
Fixed it adding config for define encoding
Gulp 5.x added utf-8 as default encoding so it generates png images to be loaded as utf-8 and fail the validation of file signature |
Yay, I'm glad it all worked out =) I'll explore reproducing and updating the documentation accordingly. My preliminary notes were:
|
It does seem I need to write a fix as part of the library. And I do see the test suite's |
Thank you for the updates! If you need more information to reproduce or test, please let me know; I'll be glad to help. I will reopen the issue to mark it as 'pending'. |
I believe I've gotten to the bottom of my complications. It's from wanting an elegant single return stream, and This can be seen when doing:
https://github.com/gulpjs/vinyl-fs/blob/v4.0.0/lib/dest/write-contents/write-stream.js#L10-L14 I'm going to carry this fix to the rest of the tests, and if that works, then docs, and if that works, then likely open an issue complaining about the choice. |
The fix worked for the rest of the tests, so I've updated the docs and released it in You'll need to update your Gulpfile Example from updated README below Thanks for writing this in! var gulp = require('gulp');
var spritesmith = require('gulp.spritesmith');
gulp.task('sprite', function () {
var spriteData = gulp.src('images/*.png', {encoding: false}).pipe(spritesmith({
imgName: 'sprite.png',
cssName: 'sprite.css'
}));
return spriteData.pipe(gulp.dest('path/to/output/', {encoding: false}));
}); EDIT: I've also opened the complaint here, gulpjs/vinyl-fs#355 |
I can't find a way to make gulp.spritesmith work with gulp 5.0.0.
This piece of code works perfectly with gulp 4.x with a list of png images
But when updating to gulp 5.x starts to return
Error within spritesmith pipe: Invalid file signature
even tho the pngs are perfectly fine, not corrupted (Already tried to validate it and all files all perfectly fine)Is it an issue with gulp.spritesmith and gulp 5.x ?
The text was updated successfully, but these errors were encountered: