Neos.Media/Classes/Domain/Model/ImageVariant.php
protected function applyAdjustment(ImageAdjustmentInterface $adjustment): void
    {
        $existingAdjustmentFound = false;
        $newAdjustmentClassName = TypeHandling::getTypeForValue($adjustment);

        foreach ($this->adjustments as $existingAdjustment) {
            if (TypeHandling::getTypeForValue($existingAdjustment) === $newAdjustmentClassName) {
                foreach (ObjectAccess::getGettableProperties($adjustment) as $propertyName => $propertyValue) {
                    ObjectAccess::setProperty($existingAdjustment, $propertyName, $propertyValue);
                }
                $existingAdjustmentFound = true;
            }
        }
        if (!$existingAdjustmentFound) {
            $this->adjustments->add($adjustment);
            $adjustment->setImageVariant($this);
            $this->adjustments = $this->adjustments->matching(new Criteria(null, ['position' => 'ASC']));
        }

        $this->lastModified = new \DateTime();
    }
protected function applyAdjustment(ImageAdjustmentInterface $adjustment): void
    {
        $existingAdjustmentFound = false;
        $newAdjustmentClassName = TypeHandling::getTypeForValue($adjustment);

        foreach ($this->adjustments as $existingAdjustment) {
            if (TypeHandling::getTypeForValue($existingAdjustment) === $newAdjustmentClassName) {
                foreach (ObjectAccess::getGettableProperties($adjustment) as $propertyName => $propertyValue) {
                    ObjectAccess::setProperty($existingAdjustment, $propertyName, $propertyValue);
                }
                $existingAdjustmentFound = true;
            }
        }
        if (!$existingAdjustmentFound) {
            $this->adjustments->add($adjustment);
            $adjustment->setImageVariant($this);
            $this->adjustments = $this->adjustments->matching(new Criteria(null, ['position' => 'ASC']));
        }

        $this->lastModified = new \DateTime();
    }
protected function applyAdjustment ( ImageAdjustmentInterface $ adjustment ) : void { $ existingAdjustmentFound = false ; $ newAdjustmentClassName = TypeHandling :: getTypeForValue ( $ adjustment ) ; foreach ( $ this -> adjustments as $ existingAdjustment ) { if ( TypeHandling :: getTypeForValue ( $ existingAdjustment ) === $ newAdjustmentClassName ) { foreach ( ObjectAccess :: getGettableProperties ( $ adjustment ) as $ propertyName => $ propertyValue ) { ObjectAccess :: setProperty ( $ existingAdjustment , $ propertyName , $ propertyValue ) ; } $ existingAdjustmentFound = true ; } } if ( ! $ existingAdjustmentFound ) { $ this -> adjustments -> add ( $ adjustment ) ; $ adjustment -> setImageVariant ( $ this ) ; $ this -> adjustments = $ this -> adjustments -> matching ( new Criteria ( null , [ 'position' => 'ASC' ] ) ) ; } $ this -> lastModified = new \ DateTime ( ) ; }
Apply the given adjustment to the image variant.
If an adjustment of the given type already exists, the existing one will be overridden by the new one.

@param ImageAdjustmentInterface $adjustment
@return void
@throws \Exception
Apply the given adjustment to the image variant . If an adjustment of the given type already exists the existing one will be overridden by the new one .