Neos.Media/Classes/Domain/Model/Image.php
public function addVariant(ImageVariant $variant)
    {
        if ($variant->getOriginalAsset() !== $this) {
            throw new \InvalidArgumentException('Could not add the given ImageVariant to the list of this Image\'s variants because the variant refers to a different original asset.', 1381416726);
        }
        $this->variants->add($variant);
    }
public function addVariant(ImageVariant $variant)
    {
        if ($variant->getOriginalAsset() !== $this) {
            throw new \InvalidArgumentException('Could not add the given ImageVariant to the list of this Image\'s variants because the variant refers to a different original asset.', 1381416726);
        }
        $this->variants->add($variant);
    }
public function addVariant ( ImageVariant $ variant ) { if ( $ variant -> getOriginalAsset ( ) !== $ this ) { throw new \ InvalidArgumentException ( 'Could not add the given ImageVariant to the list of this Image\'s variants because the variant refers to a different original asset.' , 1381416726 ) ; } $ this -> variants -> add ( $ variant ) ; }
Adds a variant of this image

Note that you should try to re-use variants if you need to adjust them, rather than creating a new
variant for every change. Non-used variants will remain in the database and block resource disk space
until they are removed explicitly or the original image is deleted.

@param ImageVariant $variant The new variant
@return void
@throws \InvalidArgumentException
Adds a variant of this image