Skip to content

API: per-version endpoint for decodable image formats #700

@lilith

Description

@lilith

Summary

Add a versioned JSON API endpoint that lists which image formats the current build can decode, along with the decoder implementation backing each format.

Motivation

Consumers (servers, UIs, documentation generators) need to know which formats are decodable at runtime. This depends on which features are enabled (c-codecs, zen-codecs) and which codec preset is active. Currently there's no API to discover this — callers must try decoding and handle errors.

Proposed endpoint

v1/schema/formats/v1/decodable

Returns a list of decodable image formats with:

  • Format name (e.g., "jpeg", "png", "webp", "gif", "jxl", "avif", "heic", "tiff", "bmp")
  • Decoder name(s) available for that format (e.g., "mozjpeg", "zenjpeg", "libpng", "zenpng")
  • Which backend each decoder belongs to (v2 or zen)
  • Whether the decoder is the active/preferred one for that format

This should reflect the runtime EnabledCodecs state, not just compile-time feature flags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions