import ( "github.com/disintegration/imageorient" _ "image/gif" _ "image/jpeg" _ "image/png" )
func GetImage(url string) (image.Image, error) { resp, err := http.Get(url) defer resp.Body.Close() if err != nil { return nil, err } img, _, err := imageorient.Decode(resp.Body) if err != nil { return nil, err } return img, nil }
im,err := s.dao.Qiniu.GetImage(data["imageUrl"])
im.Bounds().Dx() 和 im.Bounds().Dy() 是我需要的宽和高