| Crates.io | image-provider |
| lib.rs | image-provider |
| version | 0.1.0 |
| created_at | 2025-09-17 16:14:04.240841+00 |
| updated_at | 2025-09-18 06:56:56.332192+00 |
| description | Axum-based image resizer |
| homepage | |
| repository | https://github.com/xiao-e-yun/image-provider |
| max_upload_size | |
| id | 1843553 |
| size | 90,191 |
Axum-based image resizer. (like node/ipx)
http://localhost:3000/path/to/image.jpg?dpr=2&w=100&h=100&output=webp
Such as
wsrv.nl
Output Format
output: "webp", "jpeg", "png"
Device Pixel Ratio
dpr: 1 ~ 3
Width
w: Number
Height
h: Number
Download binary from releases.
Usage: image-provider [OPTIONS] [PATH]
Arguments:
[PATH] [default: .]
Options:
-p, --port <PORT>
[default: 3000]
--resize-images-filter-type <resize-images-filter-type>
Filter type to use for resizing `lanczos3` `gaussian` `catmull-rom` `hamming` `mitchell` `bilinear` `box` [default: lanczos3]
--resize-images-algorithm <resize-images-algorithm>
Resize algorithm to use `super-sampling8x` `super-sampling4x` `super-sampling2x` `convolution` `interpolation` `nearest` (nearest will ignore filter_type) [default: interpolation]
--resize-images-cache-size <resize-images-cache-size>
Maximum cached images in memory [default: 200]
-v, --verbose...
Increase logging verbosity
-q, --quiet...
Decrease logging verbosity
-h, --help
Print help
Add image_provider to your Cargo.toml:
cargo add image_provider
Create image provider router:
use image_provider::{get_images_router, ResizeConfig};
// Create images_provider router
let config = ResizeConfig::builder().build();
let images_router: Router = get_images_router(path, config);
Then you can mount images_router to your main router.