anthonynsimon / bild

Image processing algorithms in pure Go
MIT License
4.02k stars 214 forks source link

imgio.PNGEncoder() not working #75

Closed T1960CT closed 5 years ago

T1960CT commented 5 years ago

After using go get github.com/anthonynsimon/bild (go mod file shows it getting v0.10.0) and pasting the readme example, VSCode shows that imgio.PNGEncoder() doesn't exist. After looking into the /pkg/mod/github.com/anthonynsimon/bild@v0.10.0/imgio/io.go file, I only have the Open, Encode, Save functions. I'm running go 1.13, currently on a Windows 10 host.

I had to change the line: imgio.Save("output.png", rotated, imgio.PNGEncoder()) to imgio.Save("output.png", rotated, imgio.PNG)

Not sure if there's a problem with the copy served to me, or the README file is out of date, but would love some clarification if possible. Thanks!

T1960CT commented 5 years ago

The godocs do show the open, encode, save functions, but then in the example it also shows imgio.JPEGEncoder(100) (https://godoc.org/github.com/anthonynsimon/bild/imgio#Save)

Zyl9393 commented 5 years ago

The repository maintainers botched the last two version tags. It should be v0.11.1 and not 0.11.1. For the latest version, you need to require github.com/anthonynsimon/bild v0.10.1-0.20190731110047-60869ee308e5 in your go.mod until the tag is fixed.

anthonynsimon commented 5 years ago

Thanks for taking a look! I’ll fix the tag in the coming days.