Trim::resizeTrim
Resize the image with keeping ratio and tirmming overwrapped (Like object-fit: cover
)
Description
public void Trim::resizeTrim( number $w, number $h, string $cp )
Arguments
Name | Data type | Default | Remarks |
---|---|---|---|
$w | number | Converted image width | |
$h | number | Converted image height | |
$cp | string | Crop position |
Crop position
lt | t | rt |
l | m | r |
lb | b | rb |
Example
Controller
$trim = $this->getClass('Tool/RSS', 'https://example.com/feed');
$trim->setImage('path/to/image.jpg', 'path/to/converted.jpg');
$trim->resizeTrim(300, 300, 'm');