Skip to content

How to work with the Media service

Our Media Service provides the images in the appropriate sizes. This article describes the pain and a modern solution for html clients: Responsive images


MediaService has endpoint /attachments/{identifier} which delivers attachment file by it's identifier. Currently this endpoint delivers only tours maps. Example: request to /attachments/oua_123456.gpx will return you a map for tour in .GPX format.

In Content-Disposition header you are able to find information about original file name and additional information related to data.

Usually, you are able to find a link to attachment in Thing Link field that is an array of Link objects

Thumbnail creation

We are using AI to resize and crop the pictures if the requested size is smaller than 1024 pixels. The service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. If the requested image is larger than 4 MB or if the requested size is larger than 1024 pixels then a simple resizing and cropping algorithm is used.

Service is taking the identifier of an ImageObject in our Infocenter and processes its content image.{identitifier}?width={w}&height={h}

Parameter Description
identifier Identifier of the image-object
width Width of the thumbnail, in pixels.
height Height of the thumbnail, in pixels.

The image references in all Infocenter objects is extended by the basic thumbnail url:

    "thumbnailUrl": "",
    "contentUrl": "",
    "@id": "",
    "identifier": "TSVM-OUA_24211673"


  • If both width and height are missing or less than 0, the picture is returned in original size.
  • If one of parameter is bigger than original, this parameter is set to original. The ratio is kept.
  • If only one is missing the ratio is kept.
  • If any exception occurs the picture is returned in original size.
  • If the ImageObject or the in contentUrl referenced image doesn't exists "404 Not found" will be returned.

Sample app

You can check the feature in our sample app as well:

Last update: December 9, 2020 09:16:28