Пример #1
0
//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)
}
Пример #2
0
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
}
Пример #3
0
// @gist makeImageInfoUrl
func makeImageInfoUrl(imageUrl string) string {
	ii := fop.ImageInfo{}
	return ii.MakeRequest(imageUrl)
}