Open cwpearson opened 4 years ago
Hm, weird. It's been a while since I tried to save an image to png. I'll take a look at it in a few days.
Damn, this also runs perfectly fine on my linux machine. :/
But it's weird that it fails in decode
here
https://github.com/nim-lang/Nim/blob/devel/lib/pure/base64.nim#L184.
Would you be willing to test decoding the image manually on your machine? Data as base64: http://ix.io/1TOx
save it somewhere and then just run the following:
import base64
writeFile("test.png", readFile("pngAsBase64.txt").decode)
and see if that works flawlessly. It should simply create that fig12 example as test.png
.
Running the snippet on the base64 data you provided works fine!
I ran
nim c -r -d:webview --threads:on -d:debug examples/fig12_save_figure.nim
again, and I noticed that the webview pops up momentarily with what looks like a complete image rendered before the exceptions I posted before are emitted
Modifying examples/fig12_save_figure.nim to save a file with the png extension, then running
Running
nim c -r -d:webview --threads:on -d:debug examples/fig12_save_figure.nim
produces