Microservice (REST API) for generating thumbnails.
- Clone the repository
- Configure the app:
Create a file
appsettings.Development.json
in the same folder asHiP-ThumbnailService.csproj
with the following content, replacing "YOUR URL PREFIX" with a valid URL according to the documentation for ThumbnailConfig.HostUrl:{ "Thumbnails": { "HostUrl": "YOUR URL PREFIX" } }
- Launch the app
- via Visual Studio: Open the solution (*.sln) and run the app (F5)
- via Terminal: Execute
dotnet run
from the project folder containingHiP-ThumbnailService.csproj
The app is preconfigured to run on dev machines with minimal manual configuration. See appsettings.json for a list of configuration fields and their default values.
When requesting thumbnails via GET /api/Thumbnails?Url=...
, the thumbnail service retrieves the original image from another server or service, resizes and crops the image, and then returns it. The URL to the original image is constructed from two parts:
- The "HostUrl" configured in the thumbnail service
(example: "https://docker-hip.cs.upb.de/develop/") - The relative URL given by the client via
?Url=
(example: "datastore/Media/42/File")
Thumbnails of different sizes and formats are cached. When the original image changes, the service owning the image needs to clear the thumbnail cache for that image by calling DELETE /api/Thumbnails?Url=...
, otherwise the thumbnail service will continue to return the outdated, cached thumbnails.