src/components/ImageManager.php
private function _save ($path, $file, $format)
		{
			$image = ( new Imagine() )->open($file);
			$class = $this->config;
			$params = $class::get($format);
			$newSize = $this->_size($format);
			if ($class::$fit == ImageSizeFit::WIDTH)
				$this->resizeToWidth($image, $newSize->getWidth());
			elseif ($class::$fit == ImageSizeFit::HEIGHT)
				$this->resizeToHeight($image, $newSize->getHeight());
			else
				$this->_resize($image, $newSize);
			FileHelper::createDirectory(dirname($path));
			$image->save($path, [ 'jpeg_quality' => $params[ 'quality' ] ]);
		}
private function _save ($path, $file, $format)
		{
			$image = ( new Imagine() )->open($file);
			$class = $this->config;
			$params = $class::get($format);
			$newSize = $this->_size($format);
			if ($class::$fit == ImageSizeFit::WIDTH)
				$this->resizeToWidth($image, $newSize->getWidth());
			elseif ($class::$fit == ImageSizeFit::HEIGHT)
				$this->resizeToHeight($image, $newSize->getHeight());
			else
				$this->_resize($image, $newSize);
			FileHelper::createDirectory(dirname($path));
			$image->save($path, [ 'jpeg_quality' => $params[ 'quality' ] ]);
		}
private function _save ( $ path , $ file , $ format ) { $ image = ( new Imagine ( ) ) -> open ( $ file ) ; $ class = $ this -> config ; $ params = $ class :: get ( $ format ) ; $ newSize = $ this -> _size ( $ format ) ; if ( $ class :: $ fit == ImageSizeFit :: WIDTH ) $ this -> resizeToWidth ( $ image , $ newSize -> getWidth ( ) ) ; elseif ( $ class :: $ fit == ImageSizeFit :: HEIGHT ) $ this -> resizeToHeight ( $ image , $ newSize -> getHeight ( ) ) ; else $ this -> _resize ( $ image , $ newSize ) ; FileHelper :: createDirectory ( dirname ( $ path ) ) ; $ image -> save ( $ path , [ 'jpeg_quality' => $ params [ 'quality' ] ] ) ; }
Saves image to the format using sizes from settings.

@param string $path
@param string $dest
@param string $type
@param string $format
Saves image to the format using sizes from settings .