concrete/src/File/Image/BitmapFormat.php
public function getFormatFromMimeType($mimeType, $fallback = '')
    {
        $mimeType = trim(strtolower((string) $mimeType));
        switch ($mimeType) {
            case 'image/png':
                $result = static::FORMAT_PNG;
                break;
            case 'image/jpeg':
                $result = static::FORMAT_JPEG;
                break;
            case 'image/gif':
                $result = static::FORMAT_GIF;
                break;
            case 'image/vnd.wap.wbmp':
                $result = static::FORMAT_WBMP;
                break;
            case 'image/xbm':
            case 'image/x-xbm':
            case 'image/x-xbitmap':
                $result = static::FORMAT_XBM;
                break;
            default:
                $result = $fallback;
                break;
        }

        return $result;
    }
public function getFormatFromMimeType($mimeType, $fallback = '')
    {
        $mimeType = trim(strtolower((string) $mimeType));
        switch ($mimeType) {
            case 'image/png':
                $result = static::FORMAT_PNG;
                break;
            case 'image/jpeg':
                $result = static::FORMAT_JPEG;
                break;
            case 'image/gif':
                $result = static::FORMAT_GIF;
                break;
            case 'image/vnd.wap.wbmp':
                $result = static::FORMAT_WBMP;
                break;
            case 'image/xbm':
            case 'image/x-xbm':
            case 'image/x-xbitmap':
                $result = static::FORMAT_XBM;
                break;
            default:
                $result = $fallback;
                break;
        }

        return $result;
    }
public function getFormatFromMimeType ( $ mimeType , $ fallback = '' ) { $ mimeType = trim ( strtolower ( ( string ) $ mimeType ) ) ; switch ( $ mimeType ) { case 'image/png' : $ result = static :: FORMAT_PNG ; break ; case 'image/jpeg' : $ result = static :: FORMAT_JPEG ; break ; case 'image/gif' : $ result = static :: FORMAT_GIF ; break ; case 'image/vnd.wap.wbmp' : $ result = static :: FORMAT_WBMP ; break ; case 'image/xbm' : case 'image/x-xbm' : case 'image/x-xbitmap' : $ result = static :: FORMAT_XBM ; break ; default : $ result = $ fallback ; break ; } return $ result ; }
Get the bitmap format corresponding to a specific MIME type.

@param string $mimeType the MIME type to analyze
@param mixed $fallback what to return if $mimeType is not recognized

@return string|mixed
Get the bitmap format corresponding to a specific MIME type .