Laravel Image Rust
Image resizing, cropping and encoding in pure Rust, with a signed URL route and a disk cache.
cargo add laravel-image-rust
Try it
The crate's signed route resizes one of three photos from this site. Pick a size, a fit and a format: the page signs the URL, and the route makes the image once and serves it from its disk cache after.
The demo above resizes three photos from this site through the crate's own route. It only signs those three.
What it does
-
Pure Rust codecs
JPEG, PNG, WebP, AVIF and GIF without a system library. Photos are turned upright from their EXIF, and the output carries none.
-
A signed route
url() signs a size, a fit and a format for a file on a disk. The route makes each image once, caches it, and answers with an ETag.
-
Refuses what it should
A changed URL is a 403 and an unknown parameter a 400. An image too large to decode is refused from its header.
-
A chain of changes
Resize, cover, contain, crop, rotate, blur, sharpen, greyscale and place a watermark, then encode.
Hi, I'm Mischa. I've been shipping products and building ventures for over a decade. First exit at 25, second at 30. Now Partner & CPO at Ryde Ventures, an AI venture studio in Amsterdam. Currently shipping Stagent, TAP and Steddle. I write about what I learn along the way. More about me.
You might also enjoy: I gave frustrated Tesla owners a place to go, 1.250 showed up in 24 hours.