code: func (f *Fpdf) RegisterImageOptionsReader(imgName string, options ImageOptions, r io.Reader) (info *ImageInfoType) {
  	// Thanks, Ivan Daniluk, for generalizing this code to use the Reader interface.
  	if f.err != nil {
  		return
  	}
  	info, ok := f.images[imgName]
  	if ok {
  		return
  	}
  
  	// First use of this image, get info
  	if options.ImageType == "" {
  		f.err = fmt.Errorf("image type should be specified if reading from custom reader")
  		return
  	}
  	options.ImageType = strings.ToLower(options.ImageType)
  	if options.ImageType == "jpeg" {
  		options.ImageType = "jpg"
  	}
  	switch options.ImageType {
  	case "jpg":
  		info = f.parsejpg(r)
  	case "png":
  		info = f.parsepng(r, options.ReadDpi)
  	case "gif":
  		info = f.parsegif(r)
  	default:
  		f.err = fmt.Errorf("unsupported image type: %s", options.ImageType)
  	}
  	if f.err != nil {
  		return
  	}
  
  	if info.i, f.err = generateImageID(info); f.err != nil {
  		return
  	}
  	f.images[imgName] = info
  
  	return
  }
docs: // RegisterImageOptionsReader registers an image, reading it from Reader r, adding it
  // to the PDF file but not adding it to the page. Use Image() with the same
  // name to add the image to the page. Note that tp should be specified in this
  // case.
  //
  // See Image() for restrictions on the image and the options parameters.