withastro/roadmap

Assets: Can't use JPEG XL image source

Closed this issue · 1 comments

Astro Info

Astro                    v4.14.4
Node                     v22.4.0
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Cannot use JXL images

20:08:32 [ERROR] Failed to parse source for import analysis because the content contains invalid JS syntax. You may need to install appropriate plugins to handle the .jxl file format, or if it's an asset, add "**/*.jxl" to `assetsInclude` in your configuration.

What's the expected result?

JXL can be used as an image input similar to other formats like JPEG, PNG, WebP, etc.

Okay, why JXL?

  • Safari supports JXL;
  • Existing JPEGs can be losslessly converted to JXL (and converted back to the exact same JPEG file), reducing the git repo size.

Link to Minimal Reproducible Example

n/a

Participation

  • I am willing to submit a pull request for this issue.

The ecosystem is not in a really good place yet for this. The libraries for getting image metadata don't support JXL, I'm not sure Sharp supports it as an input format either (and output require a custom compiled libvips) and yeah, only Safari supports it as a browser, it's tough.

Moving to a discussion since this is not a bug.