Pimcore\Model\Document\Tag\Image::applyCustomCropping PHP Method

applyCustomCropping() protected method

protected applyCustomCropping ( $thumbConfig ) : mixed
$thumbConfig
return mixed
    protected function applyCustomCropping($thumbConfig)
    {
        $cropConfig = ["width" => $this->cropWidth, "height" => $this->cropHeight, "y" => $this->cropTop, "x" => $this->cropLeft];
        $thumbConfig->addItemAt(0, "cropPercent", $cropConfig);
        // also crop media query specific configs
        if ($thumbConfig->hasMedias()) {
            foreach ($thumbConfig->getMedias() as $mediaName => $mediaItems) {
                $thumbConfig->addItemAt(0, "cropPercent", $cropConfig, $mediaName);
            }
        }
    }