code: func (f *Fpdf) ImageTypeFromMime(mimeStr string) (tp string) {
  	switch mimeStr {
  	case "image/png":
  		tp = "png"
  	case "image/jpg":
  		tp = "jpg"
  	case "image/jpeg":
  		tp = "jpg"
  	case "image/gif":
  		tp = "gif"
  	default:
  		f.SetErrorf("unsupported image type: %s", mimeStr)
  	}
  	return
  }
docs: // ImageTypeFromMime returns the image type used in various image-related
  // functions (for example, Image()) that is associated with the specified MIME
  // type. For example, "jpg" is returned if mimeStr is "image/jpeg". An error is
  // set if the specified MIME type is not supported.