Days Out Guide Banner


Table of contents
  1. Image resizing
    1. URL parameters
    2. Example request


Image resizing

The URLs of images returned by the API point to the resource in its original uploaded form without any optimisations. For optimum performance, images should always be resized to appropriate dimensions for their purpose. This can be achieved by adding a variety of query string parameters onto the image URLs.

The API relies on the ImageProcessor.NET open-source library to resize images. A full definition of the available resize modes can be found here:

http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/resize/

URL parameters

Parameter name Description Example
Width The desired width of the image width=500
Height The desired height of the image height=500
Mode
  • Pad
  • BoxPad
  • Crop
  • Min
  • Max
  • Stretch
mode=crop
Defaults to “pad”

Example request

https://www.daysoutguide.co.uk/media/1234/new-image.jpg?mode=crop&width=200&height=200

In this example “new-image.jpg” would be returned but cropped to 200px in height and 200px wide.

In the case that the supplied crop size is larger or not proportionate to the original image dimensions a black border will fill the empty space around the image.

Back to top