Repository navigation
Support AVIF and WebP uploads and fix client-side AVIF image conversion - #12
Merged
Merged
Conversation
Switches from browser-native `canvas.toBlob` to `@jsquash/avif` for more reliable client-side image conversion. Updates image upload utilities, admin uploader, and corresponding unit tests to support this change and expand supported file types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
avifandwebpformats toENCLOSURE_CATEGORIES_DICT[ENCLOSURE_CATEGORIES.IMAGE].fileTypesinsrc/shared/Constants.tsand updatedfileTypesinAdminImageUploaderApp.canvas.toBlob('image/avif')(which is unsupported by browser canvas implementations and falls back to PNG) with@jsquash/avif(WebAssembly AVIF encoder) inconvertImageToAvif.Requests.uploadandAdminImageUploaderAppto ensure converted and native AVIF images are saved with.avifextensions andimage/avifMIME types.tests/unit/client/image-upload-utils.test.tsto mock and verify@jsquash/avifencoding and fallback paths.Validation
git diff --check: Clean (0 whitespace/formatting issues).yarn typecheck: Clean (Astro diagnostics across 486 files passed with 0 errors).yarn lint:openapi: Passed.yarn cli:check: CLI workspace check passed.yarn theme-kit:test: All theme kit tests passed.yarn test: 102 unit test files (627 tests) and 17 worker test files (146 tests) all passed (773 total tests).yarn build: Production build verified with WebAssembly assets bundled intodist/client/_astro/.