Skip to content

Add env var to exclude SVG (or other passthrough-only formats) from auto webp/avif conversion #835

Description

@Object905

Currently IMAGOR_AUTO_WEBP/IMAGOR_AUTO_AVIF force content-negotiated output on every source image, including SVG. Since webp/avif are savable by libvips, SVG gets rasterized instead of passed through — even with no resize/format filters in the request URL.

Passthrough (documented behavior when the output format can't be produced by libvips) never triggers here, because auto-webp/avif always names a producible format.

Request: an env var (e.g. IMAGOR_AUTO_WEBP_EXCLUDE_MIME / similar) to skip auto format negotiation for specific source mime types — SVG being the main case — so vector sources stream through untouched while raster sources still get webp/avif optimization.
Right now we have a hacky logic on frontend to do this with thumbor. It would be nice to get rid of it.

Workaround today: disable IMAGOR_AUTO_WEBP/IMAGOR_AUTO_AVIF globally, losing the optimization for all other formats.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions