Service Endpoint

https://edge.sandcage.com/<YOUR REAL-TIME PROCESSING ENDPOINT KEY>/0.2/cover


Request Parameters

url*
requiredThe relative or absolute URL path of the source image.
To mask the absolute path of a given source file an origin mapping can be assigned to the Realtime API Key.
width

integer

1...20000

optionalThe width of the resulting image.
If omitted it will default to the width of the source image.
height

integer

1...20000

optionalThe height of the resulting image.
If omitted it will default to the height of the source image.
cover
optionalThe portion of the image to return.
One or two, non-conflicting values for the "x" and "y" space.
The "x" space can take one of the following values:
  • left
  • right
  • center
The "y" space can take one of the following values:
  • top
  • bottom
  • middle
Values for both the "x" and "y" space can be provided by comma separating them. Example: y:top,x:right or x:left,y:middle
If either of the values is omitted or is not one of the accepted ones, then the default values will be "middle" for "y" and "center" for "x".
compress
optionalA boolean representation of whether or not the resulting image should be compressed.
Available options:
  • true
  • false

Default is false.
format
optionalWhether or not the file format of the resulting image should be converted to one that will produce a file with smaller file size. The returned image file format will depend on the support of the client software (e.g. browser). If omitted or set to false, then the returned image file format will be the same as the source image.
Available options:
  • auto
  • false

Default is false.
progressive
optionalA boolean representation of whether or not the file is encoded in a format that allows for progressively higher detail to be decoded prior to the complete image being delivered. Some browser limitation apply (see here). If "compress" is omitted or set to "false" it will be overrided and set to "true".
Only available for JPEGs.
Available options:
  • true
  • false

Default is false.
optimize
optionalA boolean representation of whether the engine will attempt to optimize the Huffman coding tables. If "compress" is omitted or set to "false" it will be overrided and set to "true".
Only available for JPEGs.
Available options:
  • true
  • false

Default is false.

Basic Cover Example Request

This request will return a vertically cropped image with width 300 pixels and height 100 pixels. Since the "cover" parameter was not set, it will default to "x:center,y:middle".

https://edge.sandcage.com/42adf545b6dfa7caab601c50ff743b801de4fae1/0.2/cover?url=others%2Fbefore.jpg&width=300&height=100

Result


Horizontally Cropped Cover Example Request

This request will return a horizontal cropped image with the width and height set to 200 pixels. Since the "cover" parameter was set to "x:left", the left part of the image will be returned.

https://edge.sandcage.com/42adf545b6dfa7caab601c50ff743b801de4fae1/0.2/cover?url=others%2Fbefore.jpg&width=200&height=200&cover=x:left

Result


Vertically Cropped Cover with Compression Enabled Example Request

This request will return a vertically cropped image with height 200 pixels and the width will be the same as the source image. Since the "cover" parameter was set to "y:bottom", the bottom part of the image will be returned. The returned image will also be compressed.

https://edge.sandcage.com/42adf545b6dfa7caab601c50ff743b801de4fae1/0.2/cover?url=others%2Fbefore.jpg&height=200&cover=y:bottom&compress=true

Result


Horizontally Cropped Cover with Auto-Format Enabled Example Request

This request will return a horizontally cropped image with width 500 pixels and the height will be the same as the source image. Since the "cover" parameter was set to "x:right", the right part of the image will be returned. The returned image will also be converted to the most suitable file format.

https://edge.sandcage.com/42adf545b6dfa7caab601c50ff743b801de4fae1/0.2/cover?url=others%2Fbefore.jpg&width=500&cover=x:right&format=auto

Result


Cover with Compression and Auto-Format Enabled Example Request

This request will return an image with the width set to 450 pixels and height set to 250 pixels. Since the "cover" parameter was set to "x:left,y:bottom", the left/bottom part of the image will always be returned. The returned image will also be compressed and converted to the most suitable file format.

https://edge.sandcage.com/42adf545b6dfa7caab601c50ff743b801de4fae1/0.2/cover?url=others%2Fbefore.jpg&width=450&height=250&cover=x:left,y:bottom&format=auto&compress=true

Result


Give it a try

You can adjust the options below to produce the respective parameters and see the resulting image.

768px
512px
https://edge.sandcage.com/42adf545b6dfa7caab601c50ff743b801de4fae1/0.2/cover?url=others%2Fbefore.jpg&width=768&height=512&cover=x:center,y:middle

Result


Still Have Questions?

We're always happy to help with code and integrations. Talk to us!