Skip to content

gamut: forward gamut-{jpeg,jxl,heic}'s metadata feature from the umbrella's own metadata #622

Description

@justin13888

#420 gives gamut-jpeg, gamut-jxl and gamut-heic an optional metadata Cargo feature that turns on the typed blocks() / metadata() accessors and the encoders' with_metadata. The umbrella crate's own metadata feature currently enables only the metadata crates themselves:

metadata = [
    "dep:gamut-metadata",
    "dep:gamut-exif",
    "dep:gamut-xmp",
    "dep:gamut-icc",
    "dep:gamut-iptc",
    "dep:gamut-ifd",
]

so a consumer who depends on gamut with features = ["jpeg", "metadata"] gets the facade types and the JPEG codec, but not the wiring between them: JpegMetadata::metadata() is compiled out. Reaching it means depending on gamut-jpeg directly with its metadata feature, which defeats the umbrella.

Ask: add the weak, per-format forwards so the umbrella's metadata feature implies the format crates' when — and only when — that format is enabled:

metadata = [
    ...,
    "gamut-jpeg?/metadata",
    "gamut-jxl?/metadata",
    "gamut-heic?/metadata",
]

and extend it to png / webp / avif / tiff as #510 wires them.

Checks that must stay green: mise run check-ffi-features (no new feature name is introduced, so gamut-ffi's table should already mirror it — confirm), mise run check-release-deps, and a cargo test -p gamut --all-features that actually exercises one forwarded accessor so the edge cannot rot silently.

Split out of #420: that branch's manifest is the format crates, and this is a change to crates/gamut/Cargo.toml. Related: #543 (the same shape for gamut-exif's describe).

Refs #420, #416.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions