imgconv
imgconv copied to clipboard
"panic" during convert operation
Hello.
Library works quite well, but i encountered one issue : a panic() at runtime ... this should have been handled in another way (in order to not stop the surrounding program).
Code is basically :
destImage := imgconv.Resize(src, &imgconv.ResizeOption{Width: 960})
Stack is :
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xb89cc1]
goroutine 1 [running]:
github.com/sunshineplan/imgconv.resize({0x0, 0x0}, 0x3c0, 0x0, {0x1594460?, 0xda53f8?})
(REDACTED)/go/pkg/mod/github.com/sunshineplan/[email protected]/imaging.go:132 +0x81
github.com/sunshineplan/imgconv.(*ResizeOption).do(0xc00067a5c0?, {0x0?, 0x0?})
(REDACTED)/go/pkg/mod/github.com/sunshineplan/[email protected]/resize.go:22 +0xbb
github.com/sunshineplan/imgconv.Resize(...)
(REDACTED)/go/pkg/mod/github.com/sunshineplan/[email protected]/resize.go:14
main.processUnsorted({0x7ffcfef1868f, 0x11})
(REDACTED).go:505 +0x89b
main.main()
(REDACTED).go:423 +0x1d1
Of course there is the "why is it failing" (i have no idea : the processed image is fully working / openable with other tools), but anyway, my main problem here is the panic(), that is breaking the execution (= even in case of internal errors, the library should just return an error)