axum-image

Crates.ioaxum-image
lib.rsaxum-image
version0.1.1
created_at2025-08-24 16:02:08.440724+00
updated_at2025-08-24 16:07:09.527464+00
descriptionImage extractors for Axum
homepage
repositoryhttps://trisua.com/t/axum-image
max_upload_size
id1808551
size86,288
trisua (trisuaso)

documentation

README

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.

Commit count: 0

cargo fmt