Scale
Image scaling parameters (width, height, factor, stretch) for an image transformation.
Notesโ
Scaling can be expressed two ways, and both are applied when both are set:
factor resizes by a ratio, while width and height resize toward a target
size. Scaling happens before rotation and cropping.
Usageโ
- YAML
- JSON
- XML
factor: 0
height: 0
stretch: false
width: 0
{
"factor": 0,
"height": 0,
"stretch": false,
"width": 0
}
<scale>
<factor>0</factor>
<height>0</height>
<stretch>false</stretch>
<width>0</width>
</scale>
Propertiesโ
| Property | Type | Required | Default |
|---|---|---|---|
factor | number | No | - |
height | integer | No | - |
stretch | boolean | No | false |
width | integer | No | - |
Property Detailsโ
factorโ
Ratio applied to both dimensions โ 0.5 halves the image, 2 doubles it.
Aspect ratio is always preserved.
heightโ
Target height in pixels. If only one of height and width is set, the same
value is used for both. What the target means depends on stretch.
stretchโ
Whether the image may be distorted to hit the target size exactly. Default is
false, which treats width and height as a bounding box and preserves the
aspect ratio โ the result fits inside the box but rarely fills it. Set it to
true to force the exact dimensions.
widthโ
Target width in pixels. If only one of height and width is set, the same
value is used for both. What the target means depends on stretch.