code: func imageConfigFromReader(r io.Reader) (io.Reader, image.Config, error) {
  	header := new(bytes.Buffer)
  	tr := io.TeeReader(r, header)
  	// We just need width & height for memory considerations, so we use the
  	// standard library's DecodeConfig, skipping the EXIF parsing and
  	// orientation correction for images.DecodeConfig.
  	// image.DecodeConfig is able to deal with HEIC because we registered it
  	// in internal/images.
  	conf, format, err := image.DecodeConfig(tr)
  	if err == nil && format == "heic" {
  		err = images.ErrHEIC
  	}
  	return io.MultiReader(header, r), conf, err
  }
docs: // imageConfigFromReader calls image.DecodeConfig on r. It returns an
  // io.Reader that is the concatentation of the bytes read and the remaining r,
  // the image configuration, and the error from image.DecodeConfig.
  // If the image is HEIC, and its config was decoded properly (but partially,
  // because we don't do ColorModel yet), it returns images.ErrHEIC.