get the body data portion of a base64 image

const img_uri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAD..."
const img_body = getBase64ImageBody(img_uri) // == "iVBORw0KGgoAAAANSUhEUgAAD..."
  • Parameters

    • str:
          | `data:image/gif;base64,${string}`
          | `data:image/jpeg;base64,${string}`
          | `data:image/jpg;base64,${string}`
          | `data:image/png;base64,${string}`
          | `data:image/svg+xml;base64,${string}`
          | `data:image/webp;base64,${string}`

    Returns string