-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
As shown in the image above using this simple code snippet below quite a bit of extra whitespace is added making it impossible to use inline
func SixelEncode(url string, width uint) string {
// download the image
resp, err := http.Get(url)
if err != nil {
log.Error("erroring getting image", "err", err)
return ""
}
defer resp.Body.Close()
// decode the image
img, _, err := image.Decode(resp.Body)
if err != nil {
log.Error("erroring decoding image", "err", err)
return ""
}
// resize image
m := resize.Resize(width, 0, img, resize.NearestNeighbor)
// encode the image as sixel and print to stdout
var buf bytes.Buffer
sixel.NewEncoder(&buf).Encode(m)
result := buf.String()
fmt.Println(result + "lol")
return result
}Metadata
Metadata
Assignees
Labels
No labels
