Grafika\Gd\Image::_guessType PHP Method

_guessType() private static method

private static _guessType ( $imageFile ) : string
$imageFile
return string
    private static function _guessType($imageFile)
    {
        // Values from http://php.net/manual/en/image.constants.php starting with IMAGETYPE_GIF.
        // 0 - unknown,
        // 1 - GIF,
        // 2 - JPEG,
        // 3 - PNG
        // 15 - WBMP
        list($width, $height, $type) = getimagesize($imageFile);
        unset($width, $height);
        if (1 == $type) {
            return ImageType::GIF;
        } else {
            if (2 == $type) {
                return ImageType::JPEG;
            } else {
                if (3 == $type) {
                    return ImageType::PNG;
                } else {
                    if (15 == $type) {
                        return ImageType::WBMP;
                    }
                }
            }
        }
        return ImageType::UNKNOWN;
    }