Skip to content

Commit

Permalink
Optimize code and resources
Browse files Browse the repository at this point in the history
  • Loading branch information
wenlng committed Dec 20, 2021
1 parent 76e0bed commit c84b2bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion captcha/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"fmt"
"image"
"image/jpeg"
"image/png"
)

/**
Expand All @@ -21,7 +22,7 @@ import (
*/
func encodingImageToBinary(img image.Image) (ret []byte) {
var buf bytes.Buffer
if err := jpeg.Encode(&buf, img, nil); err != nil {
if err := png.Encode(&buf, img); err != nil {
panic(err.Error())
}
ret = buf.Bytes()
Expand Down

0 comments on commit c84b2bf

Please sign in to comment.