public static function GetWebImageMimeTypeByHeaderCode( string $file )
   {
      $f8b = File::ReadFirstBytes( $file, 8 );
      $ext = \strtolower( File::GetExtensionName( $file ) );
      switch ( $ext )
      {
         case 'gif':
            if ( static::HasGifHeader( $file, $f8b ) )
            {
               return 'image/gif';
            }
            return false;
         case 'jpg':
         case 'jpeg':
            if ( static::HasJpegHeader( $file, $f8b ) )
            {
               return 'image/jpeg';
            }
            return false;
         case 'png':
            if ( static::HasPngHeader( $file, $f8b ) )
            {
               return 'image/png';
            }
            return false;
         default:
            return false;
      }
   }
public static function GetWebImageMimeTypeByHeaderCode( string $file )
   {
      $f8b = File::ReadFirstBytes( $file, 8 );
      $ext = \strtolower( File::GetExtensionName( $file ) );
      switch ( $ext )
      {
         case 'gif':
            if ( static::HasGifHeader( $file, $f8b ) )
            {
               return 'image/gif';
            }
            return false;
         case 'jpg':
         case 'jpeg':
            if ( static::HasJpegHeader( $file, $f8b ) )
            {
               return 'image/jpeg';
            }
            return false;
         case 'png':
            if ( static::HasPngHeader( $file, $f8b ) )
            {
               return 'image/png';
            }
            return false;
         default:
            return false;
      }
   }
public static function GetWebImageMimeTypeByHeaderCode ( string $ file ) { $ f8b = File :: ReadFirstBytes ( $ file , 8 ) ; $ ext = \ strtolower ( File :: GetExtensionName ( $ file ) ) ; switch ( $ ext ) { case 'gif' : if ( static :: HasGifHeader ( $ file , $ f8b ) ) { return 'image/gif' ; } return false ; case 'jpg' : case 'jpeg' : if ( static :: HasJpegHeader ( $ file , $ f8b ) ) { return 'image/jpeg' ; } return false ; case 'png' : if ( static :: HasPngHeader ( $ file , $ f8b ) ) { return 'image/png' ; } return false ; default : return false ; } }
Returns the web image MIME type, depending to file name extension and used image file header.

If its not a web image FALSE is returned. Valid web image ar images of type GIF, PNG and JPEG.

@param  string $file
@return string|FALSE
Returns the web image MIME type depending to file name extension and used image file header .