Method: size::fit_height

Fits width and height by a passed height and keeps the ratio

Info

Syntax

size::fit_height($width, $height, $fit, $force=false)

Parameters

Return (array)

An array with a key and value for width and height

Example


$new_size = size::fit_height(1200, 768, 500);
// output: array(
//    'width' => 781,
//    'height' => 500
// );

$new_size = size::fit_height(1200, 768, 3000, true);
// output: array(
//    'width' => 4687,
//    'height' => 3000
// );