fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.34k stars 352 forks source link

Check errors from Close method in SavePNG and SaveJPG #176

Open peterstace opened 1 year ago

peterstace commented 1 year ago

When closing the file, errors can still occur that might not be surfaced during the writes from png.Encode and jpeg.Encode. By returning the error from file.Close(), these cases can be caught.

sbinet commented 1 year ago

FYI, something along these lines has been done in "my" fork of gg: