A simple and lightweight service to make media information and metadata accessible as REST service.
It can for example be used to complement image servers like digilib.
Includes a 3 tier cache for snappy responsiveness.
There is one REST service end point by now:
/info?file=${filePath}
Optional query parameters:
refresh=true: update the cache with the media metadata for the file specified.
Example response:
{
"bitPerPixel": 24,
"colorType": "YCbCr",
"formatName": "JPEG (Joint Photographic Experts Group) Format",
"height": 1024,
"metaData": {
"Copyright Notice": "A. Charalambous",
"DateTime": "'2020:03:07 10:59:29'",
"ExifOffset": "2242",
"Keywords": null,
"Orientation": "1",
"Padding": null,
"ProcessingSoftware": "'Windows Photo Editor 10.0.10011.16384'",
"Software": "'Windows Photo Editor 10.0.10011.16384'"
},
"mimeType": "image/jpeg",
"width": 576
}Currently only image files are supported.
The service expects one mandatory configuration parameter
mediaHome: The root folder where the media files are found.
Optional configuration parameter
cacheExpirationMinutesorcacheExpirationHours: These are exclusive options,cacheExpirationHoursis set to 24 hours per default. In order to set one of these values toNULLthe string"@null"can be used in configurations.
For more details on the principle options of how to set the configuration property see https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config
in
... ...start the serverf with maven
mvn jetty:run-war
test the web service
with curl & jq
curl http://localhost:8080/info\?file=Orobanche_aegyptiaca.jpg
with httpie
http :8080/info file==Orobanche_aegyptiaca.jpg
For further reference, please consider the following sections: