Loading src/Plugin/ImageEffect/MaxSizeCropImageEffect.php +13 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,19 @@ use Drupal\image\Plugin\ImageEffect\CropImageEffect; */ class MaxSizeCropImageEffect extends CropImageEffect { /** * {@inheritdoc} */ public function transformDimensions(array &$dimensions, $uri) { // The new image will have the exact dimensions defined for the effect where specified, and the original dimension otherwise if (!empty($this->configuration['width'])) { $dimensions['width'] = $this->configuration['width']; } if (!empty($this->configuration['height'])) { $dimensions['height'] = $this->configuration['height']; } } /** * {@inheritdoc} */ Loading Loading
src/Plugin/ImageEffect/MaxSizeCropImageEffect.php +13 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,19 @@ use Drupal\image\Plugin\ImageEffect\CropImageEffect; */ class MaxSizeCropImageEffect extends CropImageEffect { /** * {@inheritdoc} */ public function transformDimensions(array &$dimensions, $uri) { // The new image will have the exact dimensions defined for the effect where specified, and the original dimension otherwise if (!empty($this->configuration['width'])) { $dimensions['width'] = $this->configuration['width']; } if (!empty($this->configuration['height'])) { $dimensions['height'] = $this->configuration['height']; } } /** * {@inheritdoc} */ Loading