Fix win32 errors and errors in the png saving code.
Fix win32 errors and errors in the png saving code.

Gilead/nvidia-texture-tools,Gilead/nvidia-texture-tools,Gilead/nvidia-texture-tools,Gilead/nvidia-texture-tools