Process all saved image calls on Image object

@return Intervention\Image\Image
977016
public function process()
    {
        // first call on manager
        $this->image = $this->manager;

        // process calls on image
        foreach ($this->getCalls() as $call) {
            $this->processCall($call);
        }

        // append checksum to image
        $this->image->cachekey = $this->checksum();

        // clean-up
        $this->clearCalls();
        $this->clearProperties();

        return $this->image;
    }
1040317
public function actionProcess()
    {
        ini_set("memory_limit", "512M");

        $imaging = \Yii::$app->imaging;
        if (!$imaging) {
            //TODO: можно добавить проверку YII ensure...
            throw new \yii\base\Exception("Component Imaging not found");
        }

        $newFileSrc = \Yii::$app->request->getPathInfo();
        $extension = Imaging::getExtension($newFileSrc);

        if (!$extension) {
            throw new \yii\base\Exception("Extension not found: ".$newFileSrc);
        }


        if (!$imaging->isAllowExtension($extension)) {
            throw new \yii\base\Exception("Extension '{$extension}' not supported in Imaging component");
        }


        $newFile = File::object($newFileSrc);
        $strposFilter = strpos($newFileSrc, "/".Imaging::THUMBNAIL_PREFIX);
        if (!$strposFilter) {
            throw new NotFoundHttpException("This is not a filter thumbnail: ".$newFileSrc);
        }

        $originalFileSrc = substr($newFileSrc, 0, $strposFilter).".".$newFile->getExtension();

        //TODO: hardcode delete it in the future
        $webRoot = \Yii::getAlias('@webroot');

        $originalFileRoot = $webRoot.DIRECTORY_SEPARATOR.$originalFileSrc;
        $newFileRoot = $webRoot.DIRECTORY_SEPARATOR.$newFileSrc;
        $newFileRootDefault = $webRoot.DIRECTORY_SEPARATOR.str_replace($newFile->getBaseName(),
                Imaging::DEFAULT_THUMBNAIL_FILENAME.".".$extension, $newFileSrc);

        $originalFile = new File($originalFileRoot);

        if (!$originalFile->isExist()) {
            throw new NotFoundHttpException("The original file is not found: ".$newFileSrc);
        }

        //Проверено наличие оригинального файла, есть пути к оригиналу, и результирующему файлу.
        //Отслось собрать фильтр, и проверить наличие параметров. А так же проверить разрешены ли эти параметры, для этого в строке есть захэшированный ключь

        $filterSting = substr($newFileSrc, ($strposFilter + strlen(DIRECTORY_SEPARATOR.Imaging::THUMBNAIL_PREFIX)),
            strlen($newFileSrc));
        $filterCode = explode("/", $filterSting);
        $filterCode = $filterCode[0]; //Код фильтра

        //Если указаны парамтры, то ноужно проверить контрольную строчку, и если они не соответствуют ей, то ничего делать не будем
        if ($params = \Yii::$app->request->get()) {
            $pramsCheckArray = explode(DIRECTORY_SEPARATOR, $filterSting);
            if (count($pramsCheckArray) < 3) {
                throw new \yii\base\Exception("the control line not found: ".$newFileSrc);
            }

            $string = $imaging->getParamsCheckString($params);
            if ($pramsCheckArray[1] != $string) {
                throw new \yii\base\Exception("Parameters invalid: ".$newFileSrc);
            }
        }

        $filterClass = str_replace("-", "\\", $filterCode);


        if (!class_exists($filterClass)) {
            throw new \ErrorException("Filter class is not created: ".$newFileSrc);
        }

        /**
         * @var Filter $filter
         */
        $filter = new $filterClass((array)$params);
        if (!is_subclass_of($filter, Filter::className())) {
            throw new NotFoundHttpException("No child filter class: ".$newFileSrc);
        }

        try {
            //Проверяем а создан ли уже файл, и если да то просто делаем на него ссылку.
            $filter
                ->setOriginalRootFilePath($originalFileRoot)
                ->setNewRootFilePath($newFileRootDefault)
                ->save();

            if (PHP_OS === 'Windows') {
                if ($newFileRoot != $newFileRootDefault) {
                    //Не тестировалось
                    copy($newFileRootDefault, $newFileRoot);
                }
            } else {
                if ($newFileRoot != $newFileRootDefault) {
                    symlink($newFileRootDefault, $newFileRoot);
                }
            }

            $url = \Yii::$app->request->getUrl().($params ?
                    ""//"?" . http_build_query($params) . '&sx-refresh'
                    : '?sx-refresh');

            /*Header("HTTP/1.0 200 OK");
            Image::getImagine()->open($newFileRootDefault)->show('png');
            return '';*/

            return \Yii::$app->response->redirect($url, 302);

        } catch (\Exception $e) {
            return $e->getMessage();
        }
    }
855965
public function callbackLoadAllImages()
    {
        $query = (new Query())
            ->select(['image_id' => $this->imageIdFieldName])
            ->where([$this->refFieldName => $this->getItemId()])
            ->from($this->refTableName);
        
        if ($this->isSortEnabled()) {
            $query->orderBy([$this->sortIndexFieldName => SORT_ASC]);
        }
            
        $data = $query->all();
        $images = [];
        foreach ($data as $image) {
            $images[] = $this->getImageArray($image['image_id']);
        }

        return $images;
    }
1317796
public function doRemoveCroppableImage()
    {
        if ($image      =   SaltedCroppableImage::get()->byID($this->value)) {
            $image->delete();
        }

        $this->setValue('');
        return $this->FieldHolder();
    }
517380
public function ProcessAvatars() {
      $UploadImage = new Gdn_UploadImage();
      $UserData = $this->SQL->Select('u.Photo')->From('User u')->Where('u.Photo is not null')->Get();
      
      // Make sure the avatars folder exists.
      if (!file_exists(PATH_UPLOADS.'/userpics'))
         mkdir(PATH_UPLOADS.'/userpics');
      
      // Get sizes
      $ProfileHeight = C('Garden.Profile.MaxHeight', 1000);
      $ProfileWidth = C('Garden.Profile.MaxWidth', 250);
      $ThumbSize = C('Garden.Thumbnail.Size', 40);
      
      // Temporarily set maximum quality
      SaveToConfig('Garden.UploadImage.Quality', 100, FALSE);
      
      // Create profile and thumbnail sizes
      foreach ($UserData->Result() as $User) {
         try {
            $Image = PATH_ROOT . DS . 'uploads' . DS . GetValue('Photo', $User);
            $ImageBaseName = pathinfo($Image, PATHINFO_BASENAME);            
            
            // Save profile size
            $UploadImage->SaveImageAs(
               $Image,
               PATH_UPLOADS.'/userpics/p'.$ImageBaseName,
               $ProfileHeight,
               $ProfileWidth
            );
            
            // Save thumbnail size
            $UploadImage->SaveImageAs(
               $Image,
               PATH_UPLOADS.'/userpics/n'.$ImageBaseName,
               $ThumbSize,
               $ThumbSize,
               TRUE
            );
         } catch (Exception $ex) { }
      }
   }
8557
protected function getImageSizes()
    {
        if (is_callable($this->_imageSizes)) {
            return call_user_func($this->_imageSizes, $this->owner);
        } else {
            return $this->_imageSizes;
        }
    }
947411
public function process(Image $image, $command_line = '') {
        $result = new Result();
        $result->setCommandLine($command_line . ' -strip');
        return $result;
    }
49432
protected function processImage($action, InterventionImage $image)
    {
        $action = explode('_', $action);

        if (count($action) > 1)
        {
            list($method, $param) = $action;
        } else
        {
            $method = current($action);
            $param = [];
        }

        if ($method === 'crop')
        {
            $params = explode(',', $param);

            call_user_func_array([$image, 'crop'], $params);
        } else
        {
            call_user_func([$image, $method], $param);
        }

        return $this->saveImage($image);
    }
410050
public function processThumbnails()
    {
        foreach ($this->findFiles(['is_hidden' => false, 'is_deleted' => false]) as $file) {
            if ($file->isImage) {
                // create tiny thumbnail
                $this->createImage($file->id, $this->getFilterId(TinyCrop::identifier()));
                $this->createImage($file->id, $this->getFilterId(MediumThumbnail::identifier()));
            }
        }

        // force auto fix
        $this->autoFixMissingImageSources = true;

        foreach ($this->findImages() as $image) {
            if (!empty($image->file) && !$image->file->isHidden && !$image->file->isDeleted) {
                $image->source; // which forces to recreate missing sources.
            }
        }

        return true;
    }
1298672
public function image() {
        $this->check_role = 'image';
        if ($this->value instanceof File) {
            $result = in_array($this->getImageType($this->value->path_tmp), [1, 2, 3, 6]);
        } else {
            $result = in_array($this->getImageType($this->value), [1, 2, 3, 6]);
        }
        $this->checkResult($result);
        return $this;
    }
129007
public function clearImageBuffer()
    {
        $command = new Command\Image\ClearImageBufferCommand();
        $this->getComposite()->addCommand($command);
        return $this;
    }
333622
protected function process()
    {

        // query whether or not we've to upload the image files
        if ($this->getSubject()->hasCopyImages()) {
            // initialize the image path
            if ($imagePath = $this->getValue(ColumnKeys::IMAGE_PATH)) {
                // upload the file and set the new image path
                $imagePath = $this->getSubject()->uploadFile($imagePath);

                // log a message that the image has been copied
                $this->getSubject()->getSystemLogger()->debug(
                    sprintf('Successfully copied image %s => %s', $imagePath, $imagePath)
                );

                // write the new image path to the target column
                $this->setValue(ColumnKeys::IMAGE_PATH, $imagePath);
            }
        }
    }
914593
public function loadImageHandle()
    {
        if (method_exists($this, 'cacheable') && $this->cacheable()) {
            return $this->getHandleFromCache();
        }

        return $this->makeImage($this->getOriginalImageFile());
    }
209637
public function processImage($output = null, $imagineOptions = [], $operations = []) {
		user_error('processImage() is deprecated, use batchProcess() instead!', E_NOTICE);
		return $this->batchProcess($output, $operations, $imagineOptions);
	}
733419
protected function processJpeg()
    {
        $format = 'jpeg';
        $compression = \Imagick::COMPRESSION_JPEG;

        $imagick = $this->image->getCore();
        $imagick->setImageBackgroundColor('white');
        $imagick->setBackgroundColor('white');
        $imagick = $imagick->mergeImageLayers(\Imagick::LAYERMETHOD_MERGE);
        $imagick->setFormat($format);
        $imagick->setImageFormat($format);
        $imagick->setCompression($compression);
        $imagick->setImageCompression($compression);
        $imagick->setCompressionQuality($this->quality);
        $imagick->setImageCompressionQuality($this->quality);

        return $imagick->getImagesBlob();
    }
1169870
protected function process()
    {

        // initialize the array for the artefacts
        $this->artefacts = array();

        // process the images/additional images
        $this->processImages();
        $this->processAdditionalImages();

        // append the artefacts that has to be exported to the subject
        $this->addArtefacts($this->artefacts);
    }
73648
public static function bootHasImages()
    {
        // Automatically add images relationship to the cleoneable relations
        Event::listen('cloner::cloning: '.get_called_class(), function ($clone, $src) {
            $src->addCloneableRelation('images');
        });

        // Delete all Images if the parent is deleted.  Need to use "each" to get
        // the Image deleted events to fire.
        static::deleted(function ($model) {
            if ($model->deleteImagesWithModel()) {
                $model->images->each(function ($image) {
                    $image->delete();
                });
            }
        });

        // Automatically eager load the images relationship
        static::addGlobalScope('decoy.images', function (Builder $builder) {
            $builder->with('images');
        });
    }