Image proxy and resizer API
Added by IBM contributorIBM | Edited by Claudia R Elbourn on June 16, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

The imageProxy end-point provides an API that allows you to transform remote images referenced by an URL. In the 5.0 release, the only transformation available is the resizing operation.
End-point location: {thumbnailServiceCtxRoot}/api/imageProxy

Example: {hostname}/connections/thumbnail/api/imageProxy

 

The end-point only accepts GET HTTP requests.

 

Request parameters

Name
Description
Default value
url
Specify the URL for a remote image.
The remote image must be accessible by the image back-end service. A proxy might be necessary. Refer to the configuration section for details.
None
maxWidth
Specify the maximum width of the returned image.
500 if both maxWidth and maxHeight are specified.
maxHeight
Specify the maximum height of the returned image.
500 if both maxWidth and maxHeight are specified.

Note: If only one maxWidth or maxHeight parameter is passed, the second parameter is evaluated to preserve aspect ratio. For example, if
maxWidth = 500, maxHeight is not specified, and the image size is 1000 x 500, a maxHeight of 250 is used for the calculation to maintain the aspect ratio.


Response

  • A 200 response is always returned for a PNG image.
  • If the url is invalid or pointing to a non-existing resource, an HTTP response 404 is returned.
 

Caching

Resized images that are returned by the end-point can be considered as being static. The resized images are never updated, even if the original remote image is updated or deleted. The end-point sets long expiration response headers allowing forward proxies and browsers to aggressively cache the resized images.