You are here

public function FocalPointManagerInterface::saveCropEntity in Focal Point 8

Creates (or updates) a crop entity using relative focal point coordinates.

Relative coordinates are percentages from the top left of the image so that using 50 for both x and y would mean to put the focal point in the center of the image.

Parameters

float $x: Relative X coordinate of the focal point. Maximum is 100.

float $y: Relative Y coordinate of the focal point. Maximum is 100.

int $width: Width of the original image.

int $height: Height of the original image.

\Drupal\crop\CropInterface $crop: Crop entity for the given file.

Return value

\Drupal\crop\CropInterface Saved crop entity.

1 method overrides FocalPointManagerInterface::saveCropEntity()
FocalPointManager::saveCropEntity in src/FocalPointManager.php
Creates (or updates) a crop entity using relative focal point coordinates.

File

src/FocalPointManagerInterface.php, line 107

Class

FocalPointManagerInterface
Defines an interface for focal point manager.

Namespace

Drupal\focal_point

Code

public function saveCropEntity($x, $y, $width, $height, CropInterface $crop);