User Tools

Site Tools


image

REST-object image

The image-object is used to retrieve images from our database. Behavior for any requests other than GET is undefined.

Images that we store are *not* of a guaranteed size or format. They could be small, huge, JPEG, PNG, GIF, etc. There are two ways to retrieve images:

  1. encode the image on-the-fly. This is the recommended way of retrieving images. Images can be encoded by adding the flag resize to the retrieval URL. The image is converted using ImageMagick, with the value of resize as its argument. See ImageMagicks documentation for possible values of resize.
  2. retrieve the RAW image. This is not recommended, unless the image in its original form needs to be retrieved. You should only retrieve the raw original if you intend to do some post-processing or if you are really sure that this is what you need.

Examples

Raw images

Example URLS:

  1. http://rest.boektrust.nl/image/voorkant.978906262332.jpg - retrieve the image for the cover page of 978906262332. The size is undefined, format is jpg.
Converted images

Example URLS:

  1. http://rest.boektrust.nl/image/voorkant.978906262332.jpg?resize=150 - retrieve the image for the cover page of 978906262332. The image is resized to a width of 150.
  1. http://rest.boektrust.nl/image/voorkant.978906262331.jpg?resize=x150 - retrieve the image for the cover page of 978906262332. The image is resized to a height of 150.
image.txt · Last modified: 2019/07/18 12:41 by 127.0.0.1