parameters: (img_data, context_imagepath_map, line, DIR, recursive, relpath)
return_statement: return image
docstring: Mainly uses comprehensiveImageLoad
      But we try all space-separated items from current line when file is not found with last one
      (users keep generating/using image files with spaces in a format that does not support them, sigh...)
      Also tries to replace '_' with ' ' for Max's exporter replaces spaces with underscores.
      Also handle " chars (some software use those to protect filenames with spaces, see T67266... sic).
      Also corrects img_data (in case filenames with spaces have been split up in multiple entries, see T72148).
docstring_summary: Mainly uses comprehensiveImageLoad
      But we try all space-separated items from current line when file is not found with last one
      (users keep generating/using image files with spaces in a format that does not support them, sigh...)
      Also tries to replace '_' with ' ' for Max's exporter replaces spaces with underscores.
      Also handle " chars (some software use those to protect filenames with spaces, see T67266... sic).
      Also corrects img_data (in case filenames with spaces have been split up in multiple entries, see T72148).
docstring_tokens: Mainly uses comprehensiveImageLoad But we try all space - separated items from current line when file is not found with last one ( users keep generating / using image files with spaces in a format that does not support them sigh ... ) Also tries to replace _ with for Max s exporter replaces spaces with underscores . Also handle chars ( some software use those to protect filenames with spaces see T67266 ... sic ) . Also corrects img_data ( in case filenames with spaces have been split up in multiple entries see T72148 ) .
function: def obj_image_load(img_data, context_imagepath_map, line, DIR, recursive, relpath):
      """
      Mainly uses comprehensiveImageLoad
      But we try all space-separated items from current line when file is not found with last one
      (users keep generating/using image files with spaces in a format that does not support them, sigh...)
      Also tries to replace '_' with ' ' for Max's exporter replaces spaces with underscores.
      Also handle " chars (some software use those to protect filenames with spaces, see T67266... sic).
      Also corrects img_data (in case filenames with spaces have been split up in multiple entries, see T72148).
      """
      filepath_parts = line.split(b' ')
  
      start = line.find(b'"') + 1
      if start != 0:
          end = line.find(b'"', start)
          if end != 0:
              filepath_parts = (line[start:end],)
  
      image = None
      for i in range(-1, -len(filepath_parts), -1):
          imagepath = os.fsdecode(b" ".join(filepath_parts[i:]))
          image = context_imagepath_map.get(imagepath, ...)
          if image is ...:
              image = load_image(imagepath, DIR, recursive=recursive, relpath=relpath)
              if image is None and "_" in imagepath:
                  image = load_image(imagepath.replace("_", " "), DIR, recursive=recursive, relpath=relpath)
              if image is not None:
                  context_imagepath_map[imagepath] = image
                  del img_data[i:]
                  img_data.append(imagepath)
                  break;
          else:
              del img_data[i:]
              img_data.append(imagepath)
              break;
  
      if image is None:
          imagepath = os.fsdecode(filepath_parts[-1])
          image = load_image(imagepath, DIR, recursive=recursive, place_holder=True, relpath=relpath)
          context_imagepath_map[imagepath] = image
  
      return image
function_tokens: def obj_image_load ( img_data , context_imagepath_map , line , DIR , recursive , relpath ) : filepath_parts = line . split ( b' ' ) start = line . find ( b'"' ) + 1 if start != 0 : end = line . find ( b'"' , start ) if end != 0 : filepath_parts = ( line [ start : end ] , ) image = None for i in range ( - 1 , - len ( filepath_parts ) , - 1 ) : imagepath = os . fsdecode ( b" " . join ( filepath_parts [ i : ] ) ) image = context_imagepath_map . get ( imagepath , ... ) if image is ... : image = load_image ( imagepath , DIR , recursive = recursive , relpath = relpath ) if image is None and "_" in imagepath : image = load_image ( imagepath . replace ( "_" , " " ) , DIR , recursive = recursive , relpath = relpath ) if image is not None : context_imagepath_map [ imagepath ] = image del img_data [ i : ] img_data . append ( imagepath ) break else : del img_data [ i : ] img_data . append ( imagepath ) break if image is None : imagepath = os . fsdecode ( filepath_parts [ - 1 ] ) image = load_image ( imagepath , DIR , recursive = recursive , place_holder = True , relpath = relpath ) context_imagepath_map [ imagepath ] = image return image