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

Fallback if createImageBitmap(Blob) is not supported #9373

Open
wants to merge 4 commits into
base: v7.x
Choose a base branch
from

Conversation

dev7355608
Copy link
Collaborator

@dev7355608 dev7355608 commented Apr 14, 2023

Description of change

According to this createImageBitmap(Blob) is not supported in Safari.

  • Added canLoadImageBitmap(), which tests if loadImageBitmap() is supported.
  • Added the testImageOrVideoFormat(dataURL) helper to test if an image or video format it supported.
Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 14, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit bb052a1:

Sandbox Source
pixi.js-sandbox Configuration


return createImageBitmap(blob).then(() => true, () => false);
return testImageFormat(avifData);
Copy link
Member

Choose a reason for hiding this comment

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

Can't we simply do new Image here instead of blob/createImageBitmap? This PR seems like a lot of work to see if AVIF works. We are not trying to test if blob + createImageBitmap is supported only if the format is supported by the browser.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can't use Image, because it isn't available in workers.

@bigtimebuddy bigtimebuddy added the 🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. label May 24, 2023
@Zyie Zyie deleted the branch v7.x March 5, 2024 17:16
@Zyie Zyie closed this Mar 5, 2024
@Zyie Zyie reopened this Mar 5, 2024
@Zyie Zyie changed the base branch from dev to v7.x March 5, 2024 18:06
@Zyie Zyie added the v7 label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. v7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants