Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 669 Bytes

File metadata and controls

47 lines (36 loc) · 669 Bytes

Image Resizer CDN

FastAPI service for serving and resizing images with on-the-fly resizing via URL parameters.

Quick Start

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure .env:
ASSETS_DIR=/path/to/images
CACHE_DIR=./cache
PORT=8001
  1. Run:
uvicorn app.main:app --host 0.0.0.0 --port 8001

Usage

Original image:

GET /images/path/to/image.jpg

Resized image:

GET /images/path/to/image-1200-800.jpg

Health check:

GET /health

Features

  • On-the-fly image resizing
  • Disk caching with size limits
  • Aspect ratio preservation
  • JPEG optimization
  • CORS support