View transform for thumbnails view-transform-for-thumbnails
The image returned to the client in response to a req=tmb request is derived from the composite image by considering the following values: wid=, hei=, attribute::DefaultThumbPix, and attribute::MaxPix.
- Calculate the view rect - Use
wid=
or the width value ofattribute::DefaultThumbPix
for the width of the view rect. Usehei=
or the height value ofattribute::DefaultThumbPix
for the height. The view rect must be fully specified in this step. (Note that the view rect is the same as the layer 0 rect, if nosize=
is specified for layer 0). - Scale the composite - If
catalog::ThumbType=Crop
, then the composite is scaled to the smallest image possible while still filling the entire view rect; extra image data is cropped off. Ifcatalog::ThumbType= Fit
, then the composite is scaled to the largest image possible while still fitting the entire composite into the view rect. Ifcatalog::ThumbType=Texture
, the composite is not scaled at all to preserve the resolution specified incatalog::ThumbRes
. - Fill and crop - The view rect is filled with the
bgc=
color (or, if not specified, withattribute::ThumbBkgColor
). The scaled composite is aligned with the view rect using attribute::ThumbHorizAlign
and attribute::ThumbVertAlign
. The scaled composite is then merged with the filled view rect without further scaling. Any areas of the composite that extend beyond the view rect are cropped off.
recommendation-more-help
a26166cd-f2f4-45ce-996d-96a0f0d6cf49