EmgR
Welcome to the documentation for EmgR, a high-performance, imgproxy-compatible image resizing service built in Rust. It fetches a source image over HTTP(S), resizes/transforms it according to a signed URL, caches the result, and redirects the caller to it.
Features
- On-the-fly resizing via an imgproxy-compatible signed URL scheme - resize/crop, gravity, quality, blur, grayscale, watermarks and named presets.
- JPEG, PNG, WebP (lossy and lossless), AVIF and animated GIF/WebP output, through a SIMD resampler (
fast_image_resize) and a mozjpeg-backed JPEG decode/encode path (DCT-scaled decode, progressive/subsampling control). - Pluggable storage backends selected at compile time via Cargo feature flags: local filesystem, S3/MinIO, or in-memory (test builds only).
- HMAC-signed URLs on by default, an SSRF-guarded source fetcher, and configurable resolution/output limits.
- OpenTelemetry tracing and a bearer-token-protected
/metricsendpoint, available behind theotelfeature. - Kubernetes deployment via a Helm chart (or a Knative Service chart for serverless setups).
Before you start
Two things surprise newcomers, and both are deliberate:
emgrhas no default storage backend.Cargo.tomlsetsdefault = [], so a plaincargo buildcompiles but the resulting binary refuses to start ("No storage features are enabled"). Every build must name at least one oflocal_fs,s3, orin_memoryexplicitly.- The service fails closed at startup unless signed URLs are configured (
SIGNING_KEY+SIGNING_SALT) or you explicitly opt out withALLOW_UNSIGNED_REQUESTS=true. A build with theotelfeature adds a second, independent check for/metrics.
See Getting Started → Installation for the full explanation, the exact commands, and every feature combination CI tests.
Quick start
git clone https://github.com/vaam-store/image-resizer.git
cd image-resizer
# local_fs storage, signing turned off for local dev only - see
# Installation for the signed-URL alternative. --bin is required because
# the crate also ships `healthcheck` and `benchmark` binaries.
LOCAL_FS_STORAGE_PATH=./data/images ALLOW_UNSIGNED_REQUESTS=true \
cargo run --no-default-features --features local_fs --bin emgr
API overview
The service exposes a RESTful, imgproxy-compatible resize endpoint plus a download endpoint for already-cached results. See the API Reference for the full URL grammar, status codes and processing options, and Examples for computing a valid signature in Python/JavaScript/bash.
Architecture
The service is a hand-written Axum router (no OpenAPI code generation) over a small set of modular Rust services. See the architecture overview and components pages.
Deployment
Run it with Docker, or deploy it to Kubernetes with the Helm chart.