def image_to_string(im, cleanup=cleanup_scratch_flag, bool_digits=False):
 try:
  util.image_to_scratch(im, scratch_image_name)
  call_tesseract(scratch_image_name, scratch_text_name_root, bool_digits)
  text = util.retrieve_text(scratch_text_name_root)
 finally:
  if cleanup:
   util.perform_cleanup(scratch_image_name, scratch_text_name_root)
 return text

def image_to_string ( im , cleanup = cleanup_scratch_flag , bool_digits = False ) : try : util . image_to_scratch ( im , scratch_image_name ) call_tesseract ( scratch_image_name , scratch_text_name_root , bool_digits ) text = util . retrieve_text ( scratch_text_name_root ) finally : if cleanup : util . perform_cleanup ( scratch_image_name , scratch_text_name_root ) return text
converts im to file .