next.js
c49b7b11 - fix(next/image): improve and simplify detect-content-type (#82118)

Commit
243 days ago
fix(next/image): improve and simplify detect-content-type (#82118) Add support for detecting more src image formats via magic number. The src image formats are handled as follows: - `image/jxl` - serve as is (since safari can render it) - `image/heic` - serve as is (since safari can render it) - `image/jp2` - serve as is (since safari can render it) - `application/pdf` - error (since no browser will render it) - `image/pic` - error (since no browser will render it) We also fallback to `sharp().metadata()` if we can't detect the magic number to ensure correctness.
Author
Parents
Loading