Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.11 KB

README.md

File metadata and controls

35 lines (26 loc) · 1.11 KB

rust-image-proxy

A simple image proxy built with Actix Web.

Features

  • Convert images to .webp format.
  • Resize images.

How it works

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.

Configuration

// .env
PORT=<your-desired-port>

Example usage

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:

image