A lightweight service for handling image uploads, conversions, and storage. Supports automatic conversion to WebP format, size validation, and access via unique identifiers or codes.
- Upload images via
multipart/form-data
- Converts images (JPEG, PNG) to WebP format
- GIF images are stored without conversion
- Resizes images to a maximum of 1024x1024 (maintaining aspect ratio)
- File size validation (max 10MB)
- Unique ID and code-based retrieval
- CDN-compatible URL generation
- Optional HTTP redirect to the image URL
- Run docker compose:
docker compose up -d
- Run the application:
dotnet run --project ImageProcessor.Api
You can interact with the API using the Swagger UI available at http://localhost:5010/swagger
or via any HTTP client.
POST /api/image
- Content-Type:
multipart/form-data
- Body:
file
(image file)
Returns: 201 Created
with image metadata
GET /api/image/{id}
Returns: Image metadata or 404 Not Found
GET /api/image/code/{code}
Returns: Image metadata or 404 Not Found
GET /api/image/redirect/{code}
Returns: 302 Found
with redirect to image URL
Contributions are welcome. Fork the repository and submit a pull request with clear descriptions of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.