Closed noahlam closed 6 years ago
Thanks, I agree that base64-encoded images are useful to include in the first request instead of loading the image in a separate request, however I think WriteImage
or Image.WriteTo
are already generic enough for that and it seems having a io.Writer
that will convert PNG into data-URI would be a better approach. I mean specifically, not in captcha
package, but as a separate package that can be applied more generally, rather than each package containing their own implementation.
Ok, I respect your opinion, but I still feel that I should open a more direct API to the user. After all, not everyone is familiar with golang. The reason why I commit this pr is because I used captcha at early, and I tried a lot of methods, can not be converted image to base64 code.
add GetBase64Image API for generate a captcha in base64 format add test case for GetBase64Image API add document for GetBase64Image API