Load image as a resource
@param string $path Image filepath to load
@return resource
1256
public static function _Load ($path)
	{
		
		// Check file exists
		
		if (!parent::_Exists ($path))
		{
			return FALSE;
		}
		
		// Set image resource
		
		$image	= FALSE;
		
		// Switch image type and load
		
		switch (self::_getMIME ($path))
		{
			
			// gif
			
			case IMAGETYPE_GIF:
				$image		= imagecreatefromgif ($path);
				break;
				
			// png	
			
			case IMAGETYPE_PNG:
				$resImg		= imagecreatefrompng ($path);
				break;
				
			// jpeg / default	
			
			default:
				$image		= imagecreatefromjpeg ($path);
				break;			
			
		}
		
		// Return image resource
		
		return $image;
		
	}
89111
protected function loadFromFile($path)
    {
        if (!file_exists($path)) {
            throw new \Exception(sprintf('Map file "%s" does not exist.', $path));
        }

        $map = require($path);
        if (!is_array($map)
            || !is_array($map[Settings::ALPHABET_CYR])
            || !is_array($map[Settings::ALPHABET_LAT])
        ) {
            throw new \Exception(sprintf(
                'Map file "%s" is not valid, should return an array with %s and %s subarrays.',
                $path,
                Settings::ALPHABET_CYR,
                Settings::ALPHABET_LAT
            ));
        }

        return $map;
    }
792463
public static function from($path)
    {
        switch( self::getFileExtension($path) )
        {
            case 'png' : return imagecreatefrompng($path);
            case 'gif' : return imagecreatefromgif($path);
            case 'jpg' :
            case 'jpeg':
            default    : return imagecreatefromjpeg($path);
        }
    }
342742
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        if ($this->cache) {
            if ($this->cache->isFresh($path, filemtime($path))) {
                $feature = $this->cache->read($path);
            } elseif (null !== $feature = $this->parseFeature($path)) {
                $this->cache->write($path, $feature);
            }
        } else {
            $feature = $this->parseFeature($path);
        }

        return null !== $feature ? array($feature) : array();
    }
696392
static public function openFile($path)
	{
		if(is_readable($path))
		{
			$f = fopen($path, 'rb');
			if($f !== false)
				return new ResourceReader($f);
		}
		return null;
	}
1334355
public static function load($path)
    {
        if (is_dir($path)) {
            foreach (preg_grep('/^\.env$/', scandir($path)) as $filename) {
                $filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $filename;
                if (is_readable($filePath)) {
                    foreach (parse_ini_file($filePath) as $envKey => $envValue) {
                        putenv($envKey . '=' . $envValue);
                    }
                }
            }
        } else {
            throw new BaseException('Your path does not directory.');
        }
    }
992839
protected function getImageFiles($path)
    {
        $finder = Finder::create()->in($path)->sortByType()->depth(0);
        foreach (config('media.images_ext') as $file) {
            $finder->name('*' . $file);
        }

        return $finder;
    }
1121083
public function getResource($path)
    {
        $path = Path::normalise($path, true);
        if (empty($path)) {
            throw new InvalidArgumentException('$path is required');
        }
        if (isset($this->resources[$path])) {
            return $this->resources[$path];
        }
        return $this->resources[$path] = new ModuleResource($this, $path);
    }
1148992
public function get(string $path): Image
    {
        $this->assertPresent($path);

        $image = new Image(
            $this->filesystem->read($path),
            $this->filesystem->getMimetype($path),
            $path
        );

        return $image;
    }
287831
public function load($path)
    {
        $factory = $this;

        if (is_dir($path)) {
            foreach (Finder::create()->files()->name('*.php')->in($path) as $file) {
                require $file->getRealPath();
            }
        }

        return $factory;
    }
726823
public static function loadFile($path)
    {
        if (!realpath($path)) {
            throw new \RuntimeException('Unable to load configuration file from ' . $path);
        }

        $data = Yaml::parse($path);

        return new static(pathinfo($path, PATHINFO_DIRNAME), $data);
    }
1040090
static public function forge($path){
        switch(mimetype($path)) {
            case 'image/jpeg':
                return new Image(new Adapter\JPEG($path));
                break;
            case 'image/png':
                return new Image(new Adapter\PNG($path));
                break;
            case 'image/gif':
                return new Image(new Adapter\GIF($path));
                break;
            default:
                throw new Exception("'$path' image file is not supported");
        }
	}
870516
public function load($path)
	{
		$dir = new \DirectoryIterator(realpath($path));
		foreach ($dir as $fileInfo) {
			if($fileInfo->isFile() && $fileInfo->isReadable() && $fileInfo->getExtension()=='php') {
				$array = include $fileInfo->getPathname();
				$fileName = $fileInfo->getFilename();
				$keyName = substr($fileName, 0, strpos($fileName, '.'));
				$this->commonSettings[$keyName] = $array;
			}
		}
	}
55281
private function createFromEncrypted(string $path): self
    {
        /** @var resource $imageData */
        $imageData = file_get_contents($path);
        $this->workingData = $imageData;
        $this->encrypted = true;
        return $this;
    }
1317104
public function resource($path = null)
    {
        if (!empty($path)) {
            $this->resourcePath = $path;

            return $this;
        }

        if (!empty($this->resourcePath)) {
            return $this->resourcePath;
        }

        return app('request')->getPathInfo();
    }
649667
public function getResourceByPath($path)
    {
        // get rid of everything after the ?
        $path = \strtok($path, '?');

        $resources = $this->getResourcesAsArray($this->resources);
        foreach ($resources as $resource) {
            if ($path === $resource->getUri()) {
                return $resource;
            }
        }
        // we never returned so throw exception
        throw new ResourceNotFoundException($path);
    }
49365
public static function createFromPath(string $path)
    {
        $createFunctions = [
            'image/png' => 'imagecreatefrompng',
            'image/jpeg' => 'imagecreatefromjpeg',
            'image/gif' => 'imagecreatefromgif',
        ];

        $mimeType = mime_content_type($path);

        if (!array_key_exists($mimeType, $createFunctions)) {
            throw new InvalidMimeTypeException(sprintf('The "%s" mime type is not supported.', $mimeType));
        }

        $resource = $createFunctions[$mimeType]($path);

        return new static($resource);
    }