Inability to call external programs with spaces in their paths
Inability to call any external programs when building in unicode mode on Windows
Changes I made:
Explicitly use ASCII characters in cimg::system(). Before, it was casting the ASCII string (char) to a Unicode string (TCHAR), which was creating corrupt data that CreateProcess couldn't parse.
Remove the std::system() call that was set up as a backup if CreateProcess failed. As it turns out, std::system() on Windows has some totally bananas quoting rules that make it not able to correctly execute commands in the regular string format. Now that the parameters are fixed, CreateProcess should be able to handle all process executing needs.
Print an error message if CreateProcess fails. This helps greatly when trying to debug things. We might want to change this to an exception, not sure what your standard procedure is.
Quote the executable name in each system call. This is required for correct behavior under Windows.
I've tested that it can correctly execute ImageMagick under Windows. I haven't tested it under Linux or Mac though -- can you easily test this? If not I can try to set up a test program.
This PR fixes a couple bugs that I ran in to:
Changes I made:
I've tested that it can correctly execute ImageMagick under Windows. I haven't tested it under Linux or Mac though -- can you easily test this? If not I can try to set up a test program.