docs: def image_import(infile, force):
      """Import image anchore data from a JSON file."""
      ecode = 0
      
      try:
          with open(infile, 'r') as FH:
              savelist = json.loads(FH.read())
      except Exception as err:
          anchore_print_err("could not load input file: " + str(err))
          ecode = 1
  
      if ecode == 0:
          for record in savelist:
              try:
                  imageId = record['image']['imageId']
                  if contexts['anchore_db'].is_image_present(imageId) and not force:
                      anchore_print("image ("+str(imageId)+") already exists in DB, skipping import.")
                  else:
                      imagedata = record['image']['imagedata']
                      try:
                          rc = contexts['anchore_db'].save_image_new(imageId, report=imagedata)
                          if not rc:
                              contexts['anchore_db'].delete_image(imageId)
                              raise Exception("save to anchore DB failed")
                      except Exception as err:
                          contexts['anchore_db'].delete_image(imageId)
                          raise err
              except Exception as err:
                  anchore_print_err("could not store image ("+str(imageId)+") from import file: "+ str(err))
                  ecode = 1
  
      sys.exit(ecode)