Clients manipulating or replacing URLs are strongly recomended to read more.
The image-size
resource is a configuration service that allows you manipulate images URLs to get image in alternative physical sizes.
It provides data necessary to do string replacement on the original image URL to get a new URL to a different image size.
Responsive web and Apps need images in a variety of sizes to provide a good user experience and reduce network load. By using this simple configuration service you can choose from images ranging from 80px to 1598 px
The image-size
workspace in the Service Document contains a link to the image-size
resource:
<workspace> <atom:title>image-size</atom:title> <atom:link href="https://cache.api.finn.no/iad/image/size" rel="description" type="application/json"/> </workspace>
An example of a typical output:
{ "pattern": "/dynamic/default/", "availableSizes": [ { "width": 80, "replacement": "/dynamic/80w/" }, { "width": 228, "replacement": "/dynamic/228w/" }, { "width": 320, "replacement": "/dynamic/320w/" }, { "width": 400, "replacement": "/dynamic/400w/" }, { "width": 480, "replacement": "/dynamic/480w/" }, { "width": 640, "replacement": "/dynamic/640w/" }, { "width": 960, "replacement": "/dynamic/960w/" }, { "width": 1280, "replacement": "/dynamic/1280w/" }, { "width": 1600, "replacement": "/dynamic/1600w/" } ] }
GET HEAD
No query parameters available.
The preferred way to use the API is:
image-size
workspace from the Service Documentimage-size
resource from the link in the workspacepattern
value from the resourceavailableSizes
: Let's say you want images that are at least 300 px wide. Iterate over the width
-values and pick your best match for replacement
(here: /dynamic/320w/)pattern
with the replacement
in the original image URL
Point 1-4 only executed during application start-up.