メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

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​

NameData typeDefaultRemarks
$wintOutput width / 0: original width
$hintOutput 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();