← Projects

Laravel Image Rust

v0.1.0

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 photo at the size, fit and format above
https://mischa.sigtermans.me/img/about-japan.jpg?w=640&fm=jpg&s=dfb04bfee6a951e68819887a6dcccd99
The route refuses what it didn’t sign

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.

View on crates.io.

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.

← Projects