Im currently getting a base64 image data url from a canvas something like this (not the dataurl im getting just to show how the string looks like)
data:image/png;base64,iVkhdfjdAjdfirtn=
I need to decode that image to check the width and the height of the image
dataurl := strings.Replace(req.PostFormValue("dataurl"), "data:image/png;base64,", "", 1)
reader := base64.NewDecoder(base64.StdEncoding, strings.NewReader(dataurl))
c, _, err := image.DecodeConfig(reader)
if err != nil {
log.Fatal(err)
}
log.Println(c.Width)
But Im getting an error while trying to decode the config
Unknown image format
So yeah the way Im making the dataurl must be wrong but cant figure what to do. I also tried passing the full dataurl (with data:image...) still no success