A simple image proxy built with Actix Web.
- Convert images to .webp format.
- Resize images.
On first hit images are downloaded via reqwest and stored on disk. Subsequent hits will be served directly from disk.
Image conversion is achieved through libwebp via the Rust implementation webp.
Resizing works via the image crate.
// .env
PORT=<your-desired-port>
GET /?url=https%3A%2F%2Fplacekitten.com%2F800%2F600&w=300
Param | Description |
---|---|
url | encoded url of the target image |
w | desired width for the result |
h | desired height for the result |
Omitting either w
or h
will preserve original aspect ratio of the image.
Result: