You are here

public function AbstractAutomatedCrop::setMaxSizes in Automated Crop 8

Gets crop box size.

Parameters

int $maxWidth: The maximum width of the crop box area.

int $maxHeight: The maximum height of the crop box area.

Return value

array Array with two keys (width, height) each side dimensions as values.

Overrides AutomatedCropInterface::setMaxSizes

1 call to AbstractAutomatedCrop::setMaxSizes()
AbstractAutomatedCrop::setOriginalSize in src/AbstractAutomatedCrop.php
Set the original sizes of image.

File

src/AbstractAutomatedCrop.php, line 283

Class

AbstractAutomatedCrop
Provides a base class for each AutomatedCrop provider plugins.

Namespace

Drupal\automated_crop

Code

public function setMaxSizes($maxWidth, $maxHeight) {
  if (!empty($maxWidth)) {
    $this->cropBox['max_width'] = $maxWidth;
  }
  if (!empty($maxHeight)) {
    $this->cropBox['max_height'] = $maxHeight;
  }
  return $this;
}