//6.1.1 query image attribute func imageAttr2() { var imageUrl = "http://needkane.qiniudn.com/kane2.jpg" ii := fop.ImageInfo{} infoRet, err := ii.Call(nil, imageUrl) if err != nil { log.Println("fop getImageInfo failed:", err) return } log.Println(infoRet.Height, infoRet.Width, infoRet.ColorModel, infoRet.Format) }
func getImageInfo(imageUrl string) { var err error var ii = fop.ImageInfo{} var infoRet fop.ImageInfoRet // @gist getImageInfo infoRet, err = ii.Call(nil, imageUrl) if err != nil { // 产生错误 log.Println("fop getImageInfo failed:", err) return } log.Println(infoRet.Height, infoRet.Width, infoRet.ColorModel, infoRet.Format) // @endgist }