Using image (DecodeConfig) in Go
Package image implements a basic 2-D image library.
package main
import (
"encoding/base64"
"fmt"
"image"
"log"
"strings"
)
func main() {
reader := base64.NewDecoder(base64.StdEncoding, strings.NewReader(data))
config, format, err := image.DecodeConfig(reader)
if err != nil {
log.Fatal(err)
}
fmt.Println("Width:", config.Width, "Height:", config.Height, "Format:", format)
}