Skip to content

Using images with appropriate quality

Images can be resized to appropriate quality to reduce bandwith and memory footprints. The following example shows client requests and properties necessary for handling with resized images. Images of type JPG and PNG are supported.

Assumed that document 4208 is an image. These Client-Calls will recieve the same image with different qualities:

http://localhost:8080/insight-server/rest/documents/insight/4208

http://localhost:8080/insight-server/rest/documents/insight/4208?quality=high

http://localhost:8080/insight-server/rest/documents/insight/4208?quality=middle

http://localhost:8080/insight-server/rest/documents/insight/4208?quality=low

The following parameters must be set in insight.properties

    document.image.quality.high=1500w,1000h,0.9c
    document.image.quality.middle=800w,600h,0.6c
    document.image.quality.low=300w,200h,0.7c
    document.image.quality.thumbnail=30w,20h,0.7c

You can adjust these values or also invent your own qualities and use them in download requests.

  • w is width in pixel
  • h is heigth in pixel
  • c is compression quality of jpg

It is also possible to resize JPGs during upload to avoid resizing while downloading.

    document.image.store.additional=middle,low

If an image is stored the configuration above leads to resizing and storing of two additional jpgs with quality middle and low. These images will be used if a client requests the document in quality middle or low. Requests without a quality-qualifier will get the original image.