-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: use jpg as a fallback format #15243
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 7a7d2fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this would break transparency. if you have an avif or webp with transparency you'd lose that converting to jpg
- if the original image is a png or gif image, the intention was that you'd serve the original image as a fallback
|
We can check |
We could skip doing that if the extension is |
I don't think that's necessary, I've just looked at the source code and vite-imagetools caches the metadata object and later uses it itself to clamp the sizes to the intrinsic size of the image, unless allowUpscale is passed. So if we don't read the metadata it will be read later anyways. |
It looks like that's only true if |
|
|
closes #15242
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits