TwistPHP Documentation

resizeCover

File path: dist/twist/Core/Models/Image/Image.model.php
Namespace: Twist\Core\Models\Image
Extends:

resizeCoverGet the image to as close to the provided dimensions as possible, and then crops the remaining overflow (from the center) to get the image to be the size specified. Useful for generating thumbnails.

Parameters

Name Type Description
$intWidthintegern/a
[$intHeight = null]integern/a

Return Values

void — No return information has been documented for this function.

Example

<?php
//Set the variables for the example
$intWidth 124;
$intHeight null;

//Call the function resizeCover with the example vars
$resImage = new \Twist\Core\Models\Image\Image();
$resImage -> resizeCover($intWidth$intHeight);