make EncodedPNG method public
Marco Andronaco andronacomarco@gmail.com
Mon, 09 Sep 2024 17:36:57 +0200
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
image.go
→
image.go
@@ -87,7 +87,7 @@ }
// encodedPNG encodes an image to PNG and returns // the result as a byte slice. -func (m *Image) encodedPNG() []byte { +func (m *Image) EncodedPNG() []byte { var buf bytes.Buffer if err := png.Encode(&buf, m.Paletted); err != nil { panic(err.Error())@@ -97,7 +97,7 @@ }
// WriteTo writes captcha image in PNG format into the given writer. func (m *Image) WriteTo(w io.Writer) (int64, error) { - n, err := w.Write(m.encodedPNG()) + n, err := w.Write(m.EncodedPNG()) return int64(n), err }