Detect if specified file is image

@param string $path
@return bool
480849
public function is_image($path){
        if( !file_exists($path) || !($info = getimagesize($path)) ){
            return false;
        }
        return (bool) preg_match("/^image\/(jpeg|png|gif)$/", $info['mime']);
    }
829436
private static function isAbsolute($path)
    {
        $path = trim($path);

        if ($path === '') {
            return false;
        }

        $length = strcspn($path, '/\\');

        return $length === 0 || $path[$length - 1] === ':';
    }
793260
public function isValidPath($path)
    {
        $isValidPath = false;

        $pathValue = $this->getValueByPath($path);
        if (!is_null($pathValue)) {
            $isValidPath = true;
        }

        return $isValidPath;
    }
262745
protected function checkIfPathToFileCheckPrefix(string $path): bool
    {
        if (file_exists($path) === true) {
            return substr($path, 0, 7) === 'file://';
        }

        return true;
    }
481011
public function isDir($path)
    {
        $node = $this->at($path);
        return null !== $node && 'dir' === $node->type;
    }
89666
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

        if ($this->s3Client->doesObjectExist($this->bucket, $location, $this->options)) {
            return true;
        }

        return $this->doesDirectoryExist($location);
    }
1349290
public function has($path)
    {
        $object = $this->applyPathPrefix($path);

        try {
            $exists = $this->client->doesObjectExist($this->bucket, $object);
        } catch (OssException $e) {
            return false;
        }

        return $exists;
    }
832293
protected function isTempFile($path)
    {
        // We're only interested in the basename.
        list(, $tempPath) = Uri\split($path);

        foreach ($this->temporaryFilePatterns as $tempFile) {
            if (preg_match($tempFile, $tempPath)) {
                return $this->getDataDir().'/sabredav_'.md5($path).'.tempfile';
            }
        }

        return false;
    }
644410
function is_dir($path)
    {
        $result = $this->_get_stat_cache_prop($path, 'type');
        if ($result === false) {
            return false;
        }
        return $result === NET_SFTP_TYPE_DIRECTORY;
    }
711244
public function md5File($path)
    {
        if (! $this->isFile($path))
            return false;
        return md5($this->at($path)->content);
    }
5891
public static function isAbsolute($path)
    {
        if (($position = strpos($path, './')) !== false && $position <= 2) {
            return false;
        }
        if (strpos($path, ':') !== false) {
            return true;
        }
        if (substr($path, 0, 1) === '/') {
            return true;
        }
        return false;
    }
695238
public function has ($path) {
		try {
			$this -> get($path);
			return true;
		} catch (InvalidKeyException $e) {
			return false;
		} catch (NonExistentKeyException $e) {
			return false;
		}
	}
221033
public function isFolder($path = null)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string', 'null');

        //if path is string
        if (is_string($path)) {
            //return path appended
            return is_dir($this->data.'/'.$path);
        }

        return is_dir($this->data);
    }
470974
public static function isBinary($path)
    {
        self::fullpath($path);

        $size = filesize($path);

        if ($size >= 0 && $size < 2) {
            return false;
        }

        $finfo  = finfo_open(FILEINFO_MIME_ENCODING);
        $encode = finfo_buffer($finfo, file_get_contents($path, false, null, 0, 5012));
        finfo_close($finfo);

        return strcasecmp($encode, 'binary') === 0;
    }
168614
public static function isDirectory(string $path) : bool
    {
        try {
            return ErrorCatcher::run(static function() use ($path) {
                return is_dir($path);
            });
        } catch (\ErrorException $e) {
            throw new IoException('Error checking if ' . $path . ' is a directory', 0, $e);
        }
    }
253388
public function isDir($path)
    {
        $path = trim($path, '/') . '/';
        return $this->clientS3->doesObjectExist($this->bucket, $path);
    }
185393
public static function is_absolute($path)
    {
        if (empty($path)) {
            return false;
        }
        if ($path[0] == '/' || $path[0] == '\\') {
            return true;
        }
        return preg_match('/^[a-zA-Z]:[\\\\\/]/', $path) == 1;
    }