-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
I'm using exec.Cmd() to run graphics magick to convert an image, reading from stdin and writing to stdout.
stdout := bytes.Buffer{}
stderr := bytes.Buffer{}
gm := exec.Command("gm", "convert", args...)
gm.Stdin = bytes.NewReader(img.Data)
gm.Stdout = &stdout
gm.Stderr = &stderr
err = gm.Run()
if err != nil {
return nil, fmt.Errorf("gm: %s", stderr.String())
}
new := stdout.Bytes()I've been using go-cmd for all my other commands, but for this use case, it doesn't seem possible, because go-cmd treats all its outputs as strings. Is that correct? I'd love to be doing other work while I wait for the conversion to finish.
Metadata
Metadata
Assignees
Labels
No labels