Skip to content
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

Vinyl-fs src corrupts image files #351

Open
vkorytska opened this issue Apr 25, 2024 · 0 comments
Open

Vinyl-fs src corrupts image files #351

vkorytska opened this issue Apr 25, 2024 · 0 comments

Comments

@vkorytska
Copy link

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:

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant