@param null|string $organization

@throws \RuntimeException

@return Image
766217
public function getImageClient($organization = null)
    {
        if (!$organization) {
            $organization = $this->configuration->getOrganizationName();
        }

        if (!array_key_exists($organization, $this->imageClient)) {
            $this->imageClient[$organization] = Factory::getImageClient(
                $organization,
                $this->configuration->getApiKey(),
                [Factory::API_BASE_URL => $this->configuration->getApiUri()]
            );
        }

        return $this->imageClient[$organization];
    }
488969
protected function _getImage($Image = null) {
		if (is_string($Image)) {
			$class = 'Imagine\\' . $this->config('engine') . '\Imagine';
			$Imagine = new $class();
			return $Imagine->open($Image);
		}
		if (!empty($this->_image)) {
			return $this->_image;
		}
		throw new \RuntimeException('Could not get the image object!');
	}
1250402
private function getFile(Image $image)
    {
        $file = $image->getFile();

        if ($file instanceof \SplFileInfo) {
            return $file;
        }

        $url = $image->getUrl();

        if (null !== $url) {
            return new File($this->downloadFile($url));
        }

        return null;
    }
290561
public function defaultRender($entity)
    {
        $joinEntity = $this->getJoinEntity($entity);

        if (!$joinEntity instanceof UmbrellaFile) {
            return null;
        }

        $attr = array_merge(['title' => $joinEntity->name], $this->imageAttr);

        $url = $joinEntity->getWebPath();
        if (!empty($this->imagineFilter)) {
            $url = $this->cacheManager->getBrowserPath($url, $this->imagineFilter);
        }
        return '<img src="' . $url . '" ' . HtmlUtils::array_to_html_attribute($attr) . '>';
    }
331817
public static function imagesInternal($file = null)
    {
        return base_path(
            self::appendToPath(
                self::appendToPath(config('pxlcms.paths.base_internal'), config('pxlcms.paths.images')),
                $file
            )
        );
    }
703387
public function img($asset, $extension = null)
	{
		$extension = $extension ?: $this->detectExtensionName();

		$asset = new Image($extension, $asset);

		return $asset->link();
	}
1246436
public function getOrganization()
    {
        $node = $this->response->getFirst('contact:org', $this->node);
        if ($node === null) {
            return null;
        }

        return $node->nodeValue;
    }
503985
protected function create_organization(cc_i_organization &$org, DOMDocument &$doc, $xmlnode = null) {

        $usenew = is_object($xmlnode);
        $dnode  = $usenew ? $xmlnode : $doc->createElementNS($this->ccnamespaces['imscc'], "organization");
        $this->update_attribute($doc, 'identifier', $org->identifier, $dnode);
        $this->update_attribute($doc, 'structure', $org->structure, $dnode);

        $this->create_item_folder($org, $doc, $dnode);

        return $dnode;
    }
1118320
public function imagePath(Event $Event) {
		$data = $Event->getData();
		extract($data);

		if (!isset($data['image']['adapter'])) {
			throw new \RuntimeException(__d('file_storage', 'No adapter config key passed!'));
		}

		$adapterClass = $this->getAdapterClassName($data['image']['adapter']);
		$buildMethod = '_build' . $adapterClass . 'Path';

		if (method_exists($this, $buildMethod)) {
			return $this->$buildMethod($Event);
		}

		throw new \RuntimeException(__d('file_storage', 'No callback image url callback implemented for adapter %s', $adapterClass));
	}
1073204
public function run(Image $image)
    {
        $pixelate = $this->getPixelate();

        if ($pixelate !== null) {
            $image->pixelate($pixelate);
        }

        return $image;
    }
1216246
public function img($file, $ext=null, $theme=null) {
        
        $this->secondaryTheme($theme);
        
        $img = $this->enqueueFiles($file, $this->container->getIMG(), $ext);
        
        return $img;
        
    }
236596
public static function formatNameWithOrg($name, $organization = null)
    {
        if ($organization instanceof OrganizationInterface
                && false === strpos('__', $name)) {
            $name .= '__'.$organization->getName();
        }

        return $name;
    }
69263
public function setImage(\Core\Entity\Image $image = null) {
        $this->image = $image;

        return $this;
    }
44273
public function cropImage(Image $file, $left, $top, $width, $height, $quality = 95)
	{
		if ( ! $file instanceof Image) {
			throw new Exception\RuntimeException('Image entity expected');
		}

		$filename = $this->getFilesystemPath($file);
		$cropper = $this->getImageCropper();
		$cropper->setSourceFile($filename)
				->setOutputFile($filename)
				->setOutputQuality($quality)
				->setLeft($left)
				->setTop($top)
				->setWidth($width)
				->setHeight($height);
		$cropper->process();

		$file->setWidth($width);
		$file->setHeight($height);

		$entityManager = $this->getDoctrineEntityManager();
		$entityManager->persist($file);
		$entityManager->flush();

		$this->recreateImageSizes($file);
	}
615068
public function createChartOfAccounts(OrganizationInterface $organization)
    {
        $account = $this->accountFqcn;

        $chart = new $account($organization->getName());
        $organization->setChartOfAccounts($chart);

        $chart->addChild($assets = new $account('Assets'));
        $assets->addChild($bank = new $account('Bank'));
        $bank->addChild($checking = new $account('Checking'));

        $chart->addChild($equity = new $account('Equity'));
        $equity->addChild($opening = new $account('Opening Balance'));

        $chart->addChild($expenses = new $account('Expenses'));
        $expenses->addChild($food = new $account('Food'));
        $expenses->addChild($auto = new $account('Auto'));
        $auto->addChild($gas = new $account('Gas'));
        $expenses->addChild($childcare = new $account('Childcare'));

        $chart->addChild($income = new $account('Income'));
        $income->addChild($salary = new $account('Salary'));

        $chart->addChild($liabilities = new $account('Liabilities'));
        $liabilities->addChild($cc = new $account('Credit Cards'));

        return $chart;
    }
1023644
public function saveImage( $type = NULL )
	{
		if( !$this->source )
			throw new RuntimeException( 'No image loaded' );
		if( !$this->target )
			throw new RuntimeException( 'No modification applied' );
		if( !$this->targetUri )
			throw new RuntimeException( 'No target image URI set' );
		$type	= $type ? $type : $this->sourceInfo[2];
		switch( $type )
		{
			case IMAGETYPE_GIF:
				return imagegif( $this->target, $this->targetUri );
			case IMAGETYPE_JPEG:
				return imagejpeg( $this->target, $this->targetUri, $this->quality );
			case IMAGETYPE_PNG:
				return imagepng( $this->target, $this->targetUri );
			default:
				throw new Exception( 'Image Type "'.$type.'" is no supported' );
		}
	}
590605
protected function getImageInfo($file)
	{
		$imageInfo = getimagesize($file);

		if($imageInfo === false)
		{
			throw new RuntimeException(vsprintf('Unable to process the image [ %s ].', [$file]));
		}

		return $imageInfo;
	}