Checks whether a file is an image

@param string $name Name of the $_FILES[] field to be checked

@return bool
544264
public static function isImage($name)
    {
        if (isset($_FILES[$name])) {
            $tempFile = $_FILES[$name]['tmp_name'];
            if (!empty($tempFile) && file_exists($tempFile)) {
                $image = getimagesize($tempFile);
                switch ($image['mime']) {
                    case 'image/gif':
                    case 'image/png':
                    case 'image/bmp':
                    case 'image/tiff':
                    case 'image/jpeg':
                        return true;
                }
            }
        }

        if (file_exists($name)) {
            $image = getimagesize($name);
            switch ($image['mime']) {
                case 'image/gif':
                case 'image/png':
                case 'image/bmp':
                case 'image/tiff':
                case 'image/jpeg':
                    return true;
            }
        }

        return false;
    }
1294059
public function isFile()
    {
        if ($this->blobExists()) {
            $metadata = $this->storage->getMetaData($this->blob->path);

            return $metadata['type'] === 'file';
        }

        return false;
    }
1279312
public function isImage($file){
        $ext = $file->getExtension();
        if(in_array(strtolower($ext), $this->config["images"]["images_ext"] ) )
            return true;
        else
            return false;
    }
675587
public function hasField($name)
    {
        $result = false;
        foreach ($this->fields as $key => $fields) {
            if (isset($fields[$name])) {
                $result = true;
                break;
            }
        }
        return $result;
    }
1327224
public function hasBit(string $name) : bool
    {
        foreach ((array)$this as $element) {
            if ($element->getElement()->getValue() == $name) {
                return true;
            }
        }
        return false;
    }
654678
public function has($name)
    {
        return (is_string($name) || is_numeric($name)) && isset($this->data[$name]);
    }
1072544
public function is($name)
    {
        foreach ($this->roles as $role) {
            if ($role->name == $name || $role->slug == $name || $role->id == $name) {
                return true;
            }
        }

        return false;
    }
809276
public static function getImageSize($name)
    {
        if (isset($_FILES[$name])) {
            $tempFile = $_FILES[$name]['tmp_name'];
            if (!empty($tempFile) && file_exists($tempFile)) {
                $size = getimagesize($tempFile);

                return $size;
            }
        }

        return getimagesize($name);
    }
1103450
public function nameExists()
    {
        $name = (string) $this->getRequiredParameter('name');
        if (empty($name))
            return false;

        return array_key_exists($name, $this->_imageNames);
    }
519920
public static function isJpegFile($filename)
    {
        try {
            $image = new ImageFile($filename);
            if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_JPEG)) {
                return false;
            }

            return true;
        } catch (\RuntimeException $ex) {
            return false;
        }
    }
721938
public function has($name)
    {
        $tid = $this->getTid($name);
        if (!isset($this->_containers[$tid])) {
            return false;
        }
        return $this->_containers[$tid]->has($name);
    }
1201901
public function isInstalled(string $name): bool
    {
        $extension = $this->getAvailableExtensions()->findByName($this->getNormalizedName($name));

        if ($extension instanceof ExtensionContract) {
            return $extension->isInstalled();
        }

        return false;
    }
506677
final public function __isset($name)
    {
        $result = false;
        if($this->__manifest !== false) {
            $result = $this->__manifest->has($name);
        }

        return $result;
    }
590521
public function hasFlag(string $name): bool
    {
        $flags = array();
        $flagEntry = $this->entry[PoTokens::FLAG];
        if (!empty($flagEntry)) {
            foreach ((array) $flagEntry as $csv) {
                $temp = str_getcsv($csv, ',');
                foreach ($temp as $flag) {
                    $flag = strtolower(trim($flag));
                    $flags[$flag] = $flag;
                }
            }
            return isset($flags[strtolower(trim($name))]);
        }
        return false;
    }
193093
public static function isGifFile($filename)
    {
        try {
            $image = new ImageFile($filename);
            if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_GIF)) {
                return false;
            }

            return true;
        } catch (\RuntimeException $ex) {
            return false;
        }
    }
517069
public function hasFile(string $name) : bool
    {
        return $this->fileContentAreas->any(function (FileContentArea $contentArea) use ($name) {
            return $contentArea->name === $name;
        });
    }
223090
protected function serviceNameExists($name)
    {
        if($this->files->exists($this->getServiceDirectory() . $this->getDirOption() . $name . '.php')) {
            return true;
        }

        return false;
    }