chai2010 / webp

WebP decoder and encoder for Go (Zero Dependencies).
http://godoc.org/github.com/chai2010/webp
BSD 3-Clause "New" or "Revised" License
510 stars 88 forks source link

undefined: webp.Encode #63

Open spaiki007 opened 8 months ago

spaiki007 commented 8 months ago

func Encode(w io.Writer, m image.Image, opt *Options) (err error)

In the docks, this function is present, in fact it is not!

khanakia commented 8 months ago

I am having same issue

wes-kay commented 8 months ago

@spaiki007 @khanakia You need cgo enabled on windows,

Install GCC Set up your path.

$ env -w CGO_ENABLED=1 $ go env CGO_ENABLED >> 1

Then build.

mrhoodz commented 3 months ago

I am having same issue

same here @spaiki007

souzace commented 2 months ago

I solved following the sequence: 1) installed tdm64-gcc-10.3.0-2.exe 2) adding C:\TDM-GCC-64\bin to System Variable PATH (on top = or left). (suggestion of @StackzOfZtuff https://stackoverflow.com/users/4247268/stackzofztuff)https://stackoverflow.com/a/39867163) 3) changing CGO_ENABLED value to 1 like a sample of @wes-kay but in my case (using git bash), my command was: "setx CGO_ENABLED 1" 4) Restart Windows