Trim::resizeFill
Resize the image with keeping ratio and filling white/black color (Like object-fit: contain
)
Description
public void Trim::resizeFill( number $w, number $h )
Arguments
Name | Data type | Default | Remarks |
---|---|---|---|
$w | number | Converted image width | |
$h | number | Converted image height |
Example
Controller
$trim = $this->getClass('Tool/RSS', 'https://example.com/feed');
$trim->setImage('path/to/image.jpg', 'path/to/converted.jpg');
$trim->resizeFill(300, 300);