PHP Class Imbo\Image\Transformation\SmartSize

Author: Espen Hovlandsdal ([email protected])
Author: Kristoffer Brabrand ([email protected])
Inheritance: extends Transformation, implements Imbo\EventListener\ListenerInterface
显示文件 Open project: imbo/imbo Class Usage Examples

Public Methods

Method Description
getSubscribedEvents ( )
transform ( Imbo\EventManager\EventInterface $event ) Transform the image

Private Methods

Method Description
calculateCrop ( array $parameters ) : array Calculate the coordinates and size of the crop area
getGrowFactor ( $closeness ) Get the factor by which the crop area is grown in order to include stuff around the POI. The larger the factor, the wider the crop.
getPoiFromMetadata ( Imbo\EventManager\EventInterface $event, Image $image ) : array | false Fetch POI from metadata for the image
getSourcePercentageThreshold ( $closeness ) Get the threshold value that specifies the portion of the original width/height that the crop area should never go below.
resize ( Image $image, integer $targetWidth, $targetHeight ) Resize the image
simpleCrop ( Imbo\EventManager\EventInterface $event, integer $width, integer $height ) Perform a simple crop/resize operation on the image

Method Details

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

transform() public method

Transform the image
public transform ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The event instance