src/Creation/CapGenerator.php
public function createImage(OwnField $field)
    {
        if(!$this->imageItemFactory)
        {
            throw new ImageAggrException('Для генератора заглушек не установлена фабрика элементов!');
        }

        $type = $field->getFieldType();

        $subs = $type->getSubs('original');
        $resizeType = $subs->getSub('resize');
        $cropType = $subs->getSub('crop');

        $name = $field->getName();

        $item  = $this->imageItemFactory->createImage($field, ['name' => $name], true);

        //Ресайзы
        $resizesSet = $this->settingsSet->getImage($field)->getResizes();

        foreach($resizesSet as $resize_name => $resizeSetting)
        {
            $resizeItem  = $this->imageItemFactory->createResize($resizeType, ['name' => $resize_name], true);

            $resizeItem->getRef('original')->setItem($item);

            $item->addResize($resizeItem);
        }

        //Кропы
        $cropsSet = $this->settingsSet->getImage($field)->getCrops();

        foreach($cropsSet as $crop_name => $cropSetting)
        {
            $cropItem  = $this->imageItemFactory->createCrop($cropType, ['name' => $crop_name], true);

            $cropItem->getRef('original')->setItem($item);

            $man_name = $cropSetting->getMan()->getName();
            $target_name = $cropSetting->getTarget()->getName();

            $cropItem->getRef('man')->setItem($item->getResize($man_name));
            $cropItem->getRef('target')->setItem($item->getResize($target_name));

            $item->addCrop($cropItem);
        }

        return $item;
    }
public function createImage(OwnField $field)
    {
        if(!$this->imageItemFactory)
        {
            throw new ImageAggrException('Для генератора заглушек не установлена фабрика элементов!');
        }

        $type = $field->getFieldType();

        $subs = $type->getSubs('original');
        $resizeType = $subs->getSub('resize');
        $cropType = $subs->getSub('crop');

        $name = $field->getName();

        $item  = $this->imageItemFactory->createImage($field, ['name' => $name], true);

        //Ресайзы
        $resizesSet = $this->settingsSet->getImage($field)->getResizes();

        foreach($resizesSet as $resize_name => $resizeSetting)
        {
            $resizeItem  = $this->imageItemFactory->createResize($resizeType, ['name' => $resize_name], true);

            $resizeItem->getRef('original')->setItem($item);

            $item->addResize($resizeItem);
        }

        //Кропы
        $cropsSet = $this->settingsSet->getImage($field)->getCrops();

        foreach($cropsSet as $crop_name => $cropSetting)
        {
            $cropItem  = $this->imageItemFactory->createCrop($cropType, ['name' => $crop_name], true);

            $cropItem->getRef('original')->setItem($item);

            $man_name = $cropSetting->getMan()->getName();
            $target_name = $cropSetting->getTarget()->getName();

            $cropItem->getRef('man')->setItem($item->getResize($man_name));
            $cropItem->getRef('target')->setItem($item->getResize($target_name));

            $item->addCrop($cropItem);
        }

        return $item;
    }
@param \Interpro\Core\Contracts\Taxonomy\Fields\OwnField $field

@return \Interpro\ImageAggr\Items\ImageItem