dithergo icon indicating copy to clipboard operation
dithergo copied to clipboard

Rendering image...panic: runtime error: invalid memory address or nil pointer dereference

Open GAZ082 opened this issue 6 years ago • 1 comments

go run main.go solid.png
Rendering image...panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x4c5c5e]

goroutine 1 [running]:
image.(*Gray).Bounds(...)
        /usr/lib/go/src/image/image.go:681
github.com/esimov/dithergo.(*file).TresholdDithering(0xc420090090, 0x0, 0xc4200a4101, 0x0, 0x0, 0x0)
        /home/gabriel/go/src/github.com/esimov/dithergo/ditherer.go:88 +0x4e
github.com/esimov/dithergo.Process.func1(0x51ecc0, 0xc4200a41c0, 0x5a2c80, 0x7, 0x7, 0xc420090090, 0xc4200ac000)
        /home/gabriel/go/src/github.com/esimov/dithergo/ditherer.go:171 +0x151
github.com/esimov/dithergo.Process(0x5a2c80, 0x7, 0x7)
        /home/gabriel/go/src/github.com/esimov/dithergo/ditherer.go:191 +0x483
main.main()
        /home/gabriel/go/src/github.com/esimov/dithergo/cmd/main.go:81 +0x45
exit status 2

GAZ082 avatar Jul 16 '18 02:07 GAZ082

Could you attach the image? My opinion is that it has to do with image type conversion. But i need to check with the provided image.

esimov avatar Jul 16 '18 07:07 esimov