-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
needs triageIssue needs to be triagedIssue needs to be triaged
Description
Astro Info
Astro (>=5.15.9)
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
copy from #14861
After upgrading to the latest Astro (>=5.15.9), all SVG images stopped displaying.
Issues found:
- With
passthroughImageServiceenabled, SVG images returnContent-Type: image/nulland fail to render (JPG works).
After downgrading Astro, the regression starts at 5.15.9.
Related issues:
- passthroughImageService() does not prevent WebP conversion for Image component in Astro 5.15.2 #14721: images incorrectly converted to WebP
- fix:
passthroughImageServicegenerate webp #14776: introducedvalidateOptionsin noop.ts to address it
delete newOptions.format; -> "Content-Type": mime.lookup(format) ?? `image/${format} -> Browser Content-Type: image/null -> image boom (svg)
Changes
I believe the issue in #14721 originates from the options.format = DEFAULT_OUTPUT_FORMAT assignment in service.ts.
To address this, I added a flag to prevent setting a default output format when the noop service is used.
Although my JPG images still return image/null (but browsers can display them), SVG images now work correctly.
What's the expected result?
correctly display svg images
Link to Minimal Reproducible Example
https://stackblitz.com/edit/eya46-astro-svg-bug
Participation
- I am willing to submit a pull request for this issue.
Metadata
Metadata
Assignees
Labels
needs triageIssue needs to be triagedIssue needs to be triaged

