func describe_image(img_url_chan <-chan string, img_chan chan<- feed.FeedMedia) {
	for url := range img_url_chan {
		mt, w, h, l, _ := curl.DescribeImage(url)
		v := feed.FeedMedia{Width: w, Height: h, Length: l, Uri: url, Mime: mt}
		img_chan <- v
	}
}
Exemple #2
0
func image_dimension(uri string) (feed.FeedImage, error) {
	imgo := new_imagecache_operator()
	v, err := imgo.find(uri)
	if err == nil {
		return v, err
	}
	v.Mime, v.Width, v.Height, _, err = curl.DescribeImage(uri)
	return v, err
}