Skip to content

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.

License

Notifications You must be signed in to change notification settings

wesleybertipaglia/ImageProcessor

Repository files navigation

Image Processor

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.

Table of Contents

Features

  • 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

Getting Started

  1. Run docker compose:
docker compose up -d
  1. Run the application:
dotnet run --project ImageProcessor.Api

Usage

You can interact with the API using the Swagger UI available at http://localhost:5010/swagger or via any HTTP client.

Upload

POST /api/image

  • Content-Type: multipart/form-data
  • Body: file (image file)

Returns: 201 Created with image metadata

Get by ID

GET /api/image/{id}

Returns: Image metadata or 404 Not Found

Get by Code

GET /api/image/code/{code}

Returns: Image metadata or 404 Not Found

Redirect to Image

GET /api/image/redirect/{code}

Returns: 302 Found with redirect to image URL

Contributing

Contributions are welcome. Fork the repository and submit a pull request with clear descriptions of your changes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages