3 unstable releases

Uses new Rust 2024

new 0.2.0 Feb 3, 2026
0.1.1 Aug 24, 2025
0.1.0 Aug 24, 2025

#10 in #image-encoding

AGPL-3.0-or-later

27KB
183 lines

axum-image

Image extractors for Axum + quick image encoding helpers.

Usage

The included extractors can be used as any other extractor in Axum:

use axum_image::extract::Image;

async fn example(img: Image) -> {
    // ...
}

The JsonMultipart extractor works just as the regular Json extractor does, just with another field for bytes sent in the request.

use axum_image::extract::JsonMultipart;
use serde::Deserialize;

#[derive(Deserialize)]
struct JsonBody {
    pub field: u32,
}

async fn example(JsonMultipart(byte_parts, req): JsonMultipart<JsonBody>) -> {
    println!("field: {}", req.field);
    println!("received {} byte parts", byte_parts.len());
    // ...
}

License

axum-image is licensed under the AGPL-3.0.

Dependencies

~30MB
~524K SLoC