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

Support AVIF input assets #8380

Merged
merged 10 commits into from
Sep 11, 2023
Merged

Conversation

mattrossman
Copy link
Contributor

Changes

  • Removes vendored "image-size" packaged in favor of "probe-image-size" dependency which supports AVIF images
  • Support .avif files in the assets vite plugin and constants

Resolves #8056, #8376

Note: the "image-size" package was previoulsy vendored due to some issues with the CJS format. The "probe-image-size" package also appears to use CJS format, but I haven't personally experienced issues with it. Perhaps someone who knows more about the issues that were faced with "image-size" could verify that this dependency doesn't cause the same problem (cc @Princesseuh)

Testing

Added a test case to the "astro-assets" test. The AVIF image was created from this CC0 image and converted to AVIF using Squoosh.

All Assets tests passing, including a new case called Built the AVIF image

I also manually tested importing an AVIF image in the minimal example.

Docs

No docs added because the existing docs don't specify supported image input formats.

@mattrossman mattrossman requested a review from a team as a code owner September 2, 2023 22:50
@changeset-bot
Copy link

changeset-bot bot commented Sep 2, 2023

🦋 Changeset detected

Latest commit: 1f402a2

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Sep 2, 2023
@Princesseuh Princesseuh merged commit 345cb4a into withastro:main Sep 11, 2023
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Sep 11, 2023
Princesseuh added a commit that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assets: Can't use AVIF image source
2 participants