A big thanks to @ialexi who helped me trouble shoot this problem.
The problem is that on Window when we write out to a file it was converting newlines to CRLF. This caused the PNG files to become invalid.
To solve this problem I added check before writing chance stuff to a file. If it's writing a png file it will be written as binary, otherwise it will be written as normal. I checked both sc-server and sc-build on both OS X and Windows and spriting is working correctly in all permutations.
A big thanks to @ialexi who helped me trouble shoot this problem.
The problem is that on Window when we write out to a file it was converting newlines to CRLF. This caused the PNG files to become invalid.
To solve this problem I added check before writing chance stuff to a file. If it's writing a png file it will be written as binary, otherwise it will be written as normal. I checked both sc-server and sc-build on both OS X and Windows and spriting is working correctly in all permutations.
This fixes issue #78 .