How to get the resolution of an image from a URL in golang.
Below is the code i am trying.
resp, err := http.Get("http://i.imgur.com/Peq1U1u.jpg")
if err != nil {
// handle error
}
defer resp.Body.Close()
m, _, err := image.Decode(resp.Body)
if err != nil {
// handle error
}
g := m.Bounds()
fmt.Printf(g.String())
Can you guys tell me how to get the resolution in above situation