code: func slugsCreateByImage(ctx context.Context, db *gorm.DB, r ImageRegistry, img image.Image, w *DeploymentStream) (*Slug, error) {
  	var (
  		slug Slug
  		err  error
  	)
  
  	slug.Image, err = r.Resolve(ctx, img, w.Stream)
  	if err != nil {
  		return nil, fmt.Errorf("resolving %s: %v", img, err)
  	}
  
  	slug.Procfile, err = r.ExtractProcfile(ctx, slug.Image, w.Stream)
  	if err != nil {
  		return nil, fmt.Errorf("extracting Procfile from %s: %v", slug.Image, err)
  	}
  
  	return slugsCreate(db, &slug)
  }
docs: // SlugsCreateByImage first attempts to find a matching slug for the image. If
  // it's not found, it will fallback to extracting the process types using the
  // provided extractor, then create a slug.