all repos — captcha @ 6b957f015cd81756461087eaba38a9c6ecdcd911

Go package captcha implements generation and verification of image and audio CAPTCHAs.

make EncodedPNG method public
Marco Andronaco andronacomarco@gmail.com
Mon, 09 Sep 2024 17:36:57 +0200
commit

6b957f015cd81756461087eaba38a9c6ecdcd911

parent

aa277053b17f58213f706e2b8a9b4dd3817136e3

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M image.goimage.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 }