axum-image-endpoint
Utility Crate for upload and especially downloading/resizing images.
Example
Take a closer look at the examples folder.
use ;
use Router;
use ;
use TcpListener;
use ;
async
Basic Server Example
Basic Server
Boo
<!-- show the original image -->
<!-- change the image to a webp image -->
<!-- roate the image by 90 deg -->
<!-- change the width of the image to 120px -->
Possible query parameters:
rotate -> rotate images
width -> change width of the image, keeps ratio
height -> change height of the image, keeps ratio
grayscale -> change image to grayscale
quality -> change quality of the image to reduce file size. Works for Jpg and Webp
imgtype -> change from original imgtype to this type. Supported Img Types are Jpeg/Jpg, Png, Webp
Run example
Image resizing can be pretty slow in debug mode.
Attribution
Test Image Photo by Peter Thomas on Unsplash