Product Data Feed Image Resize and Caching

From Wiki

Jump to: navigation, search

Contents

What is the Awin Image Resize and Caching Service?

The columns awin_image_url and awin_thumb_url are filled with URLs that are derived from the feed's Merchant image URL.

These URLs provide images in sizes:

  • awin_image_url - 200 x 200 pixels
  • awin_thumb_url - 70 x 70 pixels

The images are served via our worldwide caching partner.

Images are cached for 30 days.

If an image is not available from the Merchant, a "noimage" PNG is returned.

Why did we make this change?

In August 2017, we changed from our old image resize and caching solution, where Awin downloaded all images during feed processing. This substantially delayed feed processing. This caching solution drastically reduces the time taken for us to process feeds and make them available to Publishers.

Customising Image Output

The width, height, trimming and cropping can be adjusted by changing the parameters in the URL.

w - width

Sets the width of the image, in pixels.

h - height

Sets the height of the image, in pixels

trim - remove background pixels

Trim "boring" pixels from all edges that contain values within a similarity of the top-left pixel. Trimming occurs before any resize operation. Use values between 1 and 254 to define a tolerance level to trim away similar colour values. You also can specify just &trim, which defaults to a tolerance level of 10.

bg - background colour

Sets the background colour of the image. Supports a variety of colour formats. In addition to the 140 colour names supported by all modern browsers (listed here), it also accepts hexadecimal RGB and RBG alpha formats.

Hexadecimal

  • 3 digit RGB: CCC
  • 4 digit ARGB (alpha): 5CCC
  • 6 digit RGB: CCCCCC
  • 8 digit ARGB (alpha): 55CCCCCC

t - image fit

Sets how the image is fitted to its target dimensions. Below are a couple of examples.

Fit &t=fit

Resizes the image to fit within the width and height boundaries without cropping, distorting or altering the aspect ratio. Will not oversample the image if the requested size is larger than that of the original.


Fitup &t=fitup

Resizes the image to fit within the width and height boundaries without cropping, distorting or altering the aspect ratio. Will increase the size of the image if it is smaller than the output size.


Square &t=square

Resizes the image to fill the width and height boundaries and crops any excess image data. The resulting image will match the width and height constraints without distorting the image. Will increase the size of the image if it is smaller than the output size.


Squaredown &t=squaredown

Resizes the image to fill the width and height boundaries and crops any excess image data. The resulting image will match the width and height constraints without distorting the image. Will not oversample the image if the requested size is larger than that of the original.


Absolute &t=absolute

Stretches the image to fit the constraining dimensions exactly. The resulting image will fill the dimensions, and will not maintain the aspect ratio of the input image.


Letterbox &t=letterbox

Resizes the image to fit within the width and height boundaries without cropping or distorting the image, and the remaining space is filled with the background colour. The resulting image will match the constraining dimensions.


Crop position &a=

You can also set where the image is cropped by adding a crop position. Only works when t=square. Accepts top, left, centre, right or bottom. Default is centre.

403 Access Denied, url and k parameters

You may get 403 access denied if the k= parameter is not present and complete.

Please make sure that you are not truncating the images or changing the url parameter.

HTTPS

HTTPS image serving is also supported.

Privacy

Due to new European legislation regarding how websites store information about you, AWIN is updating its privacy policy. You can see the new version of our policy here. If you would like to see the information we capture on this website, please click here for further details. In order to accept cookies on this site please click the 'I ACCEPT' button