public static function HasJpegHeader( string $file, string $firstBytes = null ) : bool
   {

      if ( empty( $firstBytes ) )
      {
         $firstBytes = File::ReadFirstBytes( $file, 4 );
      }

      return (
            ( 'ff' == \dechex( \ord( $firstBytes [ 0 ] ) ) )
         && ( 'd8' == \dechex( \ord( $firstBytes [ 1 ] ) ) )
         && ( 'ff' == \dechex( \ord( $firstBytes [ 2 ] ) ) )
      );

   }
public static function HasJpegHeader( string $file, string $firstBytes = null ) : bool
   {

      if ( empty( $firstBytes ) )
      {
         $firstBytes = File::ReadFirstBytes( $file, 4 );
      }

      return (
            ( 'ff' == \dechex( \ord( $firstBytes [ 0 ] ) ) )
         && ( 'd8' == \dechex( \ord( $firstBytes [ 1 ] ) ) )
         && ( 'ff' == \dechex( \ord( $firstBytes [ 2 ] ) ) )
      );

   }
public static function HasJpegHeader ( string $ file , string $ firstBytes = null ) : bool { if ( empty ( $ firstBytes ) ) { $ firstBytes = File :: ReadFirstBytes ( $ file , 4 ) ; } return ( ( 'ff' == \ dechex ( \ ord ( $ firstBytes [ 0 ] ) ) ) && ( 'd8' == \ dechex ( \ ord ( $ firstBytes [ 1 ] ) ) ) && ( 'ff' == \ dechex ( \ ord ( $ firstBytes [ 2 ] ) ) ) ) ; }
Returns if the defined file uses a valid JPEG image file header.

@param  string $file
@param  string $firstBytes If defined it is used to get image info from.
@return boolean
Returns if the defined file uses a valid JPEG image file header .