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

fix: treat media files as binary while packaging them #8706

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

jfedor2
Copy link
Contributor

@jfedor2 jfedor2 commented Dec 22, 2024

The basics

The details

Resolves

Fixes #8705

Proposed Changes

Adds encoding: false option to gulp.src() in packageMedia() to treat files as binary.

Reason for Changes

Without this the files are interpreted as UTF-8, which corrupts binaries like MP3s etc. This was a breaking change in gulp 5.0.0.

Test Coverage

Manually tested with:

npm run package
diff -r media dist/media

By default gulp's src() treats files as UTF-8, which corrupts binary
files like MP3s when copying them for packaging. This makes it treat
them as binary.
@jfedor2 jfedor2 requested a review from a team as a code owner December 22, 2024 20:51
@jfedor2 jfedor2 requested a review from gonfunko December 22, 2024 20:51
@github-actions github-actions bot added the PR: fix Fixes a bug label Dec 22, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome! It looks like this is your first pull request in Blockly, so here are a couple of tips:

  • You can find tips about contributing to Blockly and how to validate your changes on our developer site.
  • All contributors must sign the Google Contributor License Agreement (CLA). If the google-cla bot leaves a comment on this PR, make sure you follow the instructions.
  • We use conventional commits to make versioning the package easier. Make sure your commit message is in the proper format or learn how to fix it.
  • If any of the other checks on this PR fail, you can click on them to learn why. It might be that your change caused a test failure, or that you need to double-check the style guide.
    Thank you for opening this PR! A member of the Blockly team will review it soon.

@gonfunko
Copy link
Contributor

gonfunko commented Jan 6, 2025

Thank you for identifying and resolving this issue, we really appreciate it!

@gonfunko gonfunko merged commit dd6be31 into google:develop Jan 6, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Media files corrupted during packaging
2 participants