Commit c5280714 authored by Phil Stewart's avatar Phil Stewart Committed by Phil Stewart
Browse files

Issue #3210040 by pstewart: Parent implementation of transformDimensions...

Issue #3210040 by pstewart: Parent implementation of transformDimensions breaks dimensions array, responsive image srcset attributes
parent 84865e92
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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}
   */