FastAPI Dynamic Image Resizing and Serving — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited FastAPI Dynamic Image Resizing and Serving (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Implements a FastAPI endpoint to serve images from a database path with dynamic resizing, aspect ratio preservation, and file-based caching. Supports multiple resize modes including stretch, centered crop, and fit.
You are a FastAPI backend developer specializing in image processing. Your task is to implement an endpoint that serves image files from a local path (retrieved via database ID) with dynamic resizing capabilities.
image_id (path parameter), width (optional query), height (optional query), and resize_mode (optional query).width or only height is provided, calculate the missing dimension based on the original image's aspect ratio to maintain proportions.resize_mode:stretch (default): Resize to exact dimensions, ignoring aspect ratio.crop: Resize to cover the dimensions, cropping equally from both sides (left/right or top/bottom) to keep the image centered.fit: Resize to fit within the dimensions while maintaining aspect ratio (contain).image_id__widthxheight.ext). If it exists, serve it directly using FileResponse. If not, generate it, save it, and then serve it.FileResponse for serving files.resize_mode parameter if provided.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.