You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the issue is reproduced for Gulp.src, not for Vinyl.src, but this is relevant because Gulp.src uses Vinyl.src.
What were you expecting to happen?
The task should copy images without issue.
What actually happened?
The task corrupted the images. Similar corruption does not occur for text-based files. '{ removeBOM: false, buffer: false, encoding: false }' arguments do not fix the issue.
Added examples of corrupted images to the repository.
Please provide the following information:
OS & version [e.g. MacOS Catalina 10.15.4]: Windows 10 22H2
node version (run node -v): v21.7.3
npm version (run npm -v): 10.5.2
gulp version (run gulp -v): 5.0.0
Additional information
This issue is probably similar to aws/aws-sdk-js#1628. In the repository added a quick fix of replacing fs.createReadStream with fs.readFile and the images were copied properly.
I am not sure why specifically image files are corrupted by createReadStream, and not text files.
The text was updated successfully, but these errors were encountered:
I was able to recreate the issue when gulp.src had the same options as in the original post ({ removeBOM: false, buffer: false, encoding: false }). However the issue can not be reproduced with the following options { encoding: false }.
Having removeBOM does not make sense for encoding: false. But the issue is present when buffer: false (so some sort of bug is present there).
UPDATE: I already see the PR that addresses this... so there is no need for additional analysis.
While the issue is reproduced for Gulp.src, not for Vinyl.src, but this is relevant because Gulp.src uses Vinyl.src.
What were you expecting to happen?
The task should copy images without issue.
What actually happened?
The task corrupted the images. Similar corruption does not occur for text-based files. '{ removeBOM: false, buffer: false, encoding: false }' arguments do not fix the issue.
Please give us a sample of your gulpfile
I created a (public) repository to show the issue with src and images: https://github.com/vkorytska/gulp-src-issue.
Terminal output / screenshots
Added examples of corrupted images to the repository.
Please provide the following information:
node -v
): v21.7.3npm -v
): 10.5.2gulp -v
): 5.0.0Additional information
This issue is probably similar to aws/aws-sdk-js#1628. In the repository added a quick fix of replacing fs.createReadStream with fs.readFile and the images were copied properly.
I am not sure why specifically image files are corrupted by createReadStream, and not text files.
The text was updated successfully, but these errors were encountered: