Skip to main content

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

NameData typeDefaultRemarks
$wnumberConverted image width
$hnumberConverted 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);