JonoM\FocusPoint\FieldType\DBFocusPoint::calculateCrop
Caluclate crop data given the desired width and height, as well as original width and height.
Calculates required crop coordinates using current FocusX and FocusY
Signature
public function calculateCrop(int
$width,
int
$height,
bool
$upscale )
Parameters
$width
— int- desired width. Can be omitted as long as $height is provided.
$height
— int- desired height. Can be omitted as long as $width is provided.
$upscale
— bool- Is this being upscaled?
Returns
- array|null
- Array with fields x, y, each with array of FocusPoint, OriginalLength and TargetLength
Can return null if error