Skip to content

A pluggable image loader, with quality and unoptimized #763

Description

@romain-pm

Part of #734. Resize routing is decided inside buildImageUrl and a module cannot override it.

buildImageUrl picks the channel (provider, thumbnail, query, original) from the node's provider. A project on a CDN, a custom DAM, or a Media Optimization setup that speaks a different URL dialect has no way in.

  • loader?: (props: { src: string; width: number; quality?: number }) => string, per call and configurable module-wide. This is next/image's ImageLoaderProps exactly, and it is Astro's pluggable image service in a smaller package.
  • quality, passed to the loader. No knob exists today.
  • unoptimized, to opt a single image out of candidate generation — Next's escape hatch, Astro's passthroughImageService at call-site granularity.
  • Keep the reported channel (inspectImageChannel) meaningful when a custom loader is in play.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featA new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions