def _wider_test_jpeg(data):
 if (data[:2] == '\xff\xd8'):
  return 'jpeg'

def _wider_test_jpeg ( data ) : if ( data [ : 2 ] == '\xff\xd8' ) : return 'jpeg'
test for a jpeg file following the unix file implementation which uses the magic bytes rather than just looking for the bytes that represent jfif or exif at a fixed position .