Implement detection of image/x-icon
for next/image
component
#45998
kaguya3222
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
The next.js/test/integration/image-optimizer/test/util.ts Lines 269 to 289 in fe762d3 When there is no upstream next.js/packages/next/src/server/image-optimizer.ts Lines 112 to 144 in aeef38e Feel free to submit a PR with a test to check for the magic number of ico 👍 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature you'd like to request
Currently, Next.js tries to load icon with
fetch
request and then it determines it's content-type by following steps:image/avif
,image/webp
,image/png
,image/jpeg
,image/gif
,image/svg+xml
.So, I think it would be great if Next.js could infer
image/x-icon
content type from response buffer.Describe the solution you'd like
I want Next.js to automatically detect
image/x-icon
content type of loaded image, even if response doesn't have correctContent-Type
header.Describe alternatives you've considered
I think the only alternative is to have a correct response
Content-Type
header from URL where the loaded image is located.But, I think it will be more convenient if Next.js can automatically detect it, like it does for png, avif, webp and etc
Beta Was this translation helpful? Give feedback.
All reactions