Trim::resizeForce
Resize the image to the specified size ignoring ratio
Description
public void Trim::resizeForce( int $w, int $h )
The image is stretched to exactly $w x $h (Like object-fit: fill). 0 means the original width or height.
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $w | int | Output width / 0: original width | |
| $h | int | Output height / 0: original height |
Example
Controller
use Fegg\Tool\Trim;
$trim = new Trim();
$trim->setImage('path/to/image.jpg', 'path/to/converted.jpg');
$trim->resizeForce(300, 300);
$trim->create();