4 ms·
That's pretty cool! It would be nice if the API allowed writing to io.Writer instead of taking filenames.
by AYBABTME 9y ago
That's pretty cool! It would be nice if the API allowed writing to io.Writer instead of taking filenames.
- mmcloughlin 9y agoIf you'd like to output to an arbitrary writer, you can use the Image method. https://godoc.org/github.com/mmcloughlin/globe#Globe.Image https://godoc.org/github.com/mmcloughlin/globe#Globe.Image This can be passed to an image encoder like https://golang.org/pkg/image/png/#Encode https://golang.org/pkg/image/png/#Encode https://golang.org/pkg/image/gif/#Encode https://golang.org/pkg/image/gif/#Encode https://golang.org/pkg/image/jpeg/#Encode https://golang.org/pkg/image/jpeg/#Encode These functions take io.Writer objects. SavePNG was provided for convenience.