Closed fredroy closed 7 years ago
Is it necessary to put the examples of the CImg lib into Sofa ? The user can directly look to the CImg website. It will lighten the files into extlib by providing just the bare essentials
Hi @fredroy the windows problem seems legitimate, can you confirme that and if it is the case fix that?
I understand why VS2013 does not compile (it does not support constexpr
)
But as for VS2015 ????, the GLEW error seems unrelated....
(I am compiling on VS2015 Update 1 64b with no problem)
[ci-build]
The test reading a png file is crashing unexpectedly on Windows ; investigating....
I found the problem: the binaries shipped with the dependencies packages are compiled with a version of VS which is not 2013 or 2015. And if you dont use the same CRT version between fopen/fread/.... , libpng will crash. http://stackoverflow.com/questions/29208826/libpng-1-616-crashing-on-png-read-png-in-vs2012-c :
You are passing a (FILE*) to libpng, probably using png_init_io. Visual Studio crashes inside fread when it tries to access the underlying FILE structure.
This is because you created the FILE* using fopen from one Visual Studio runtime but libpng is linked against a different Visual Studio runtime (msvcrt or something like that); the two runtimes are incompatible.
And it is currently wokring with the present ImagePNG because this class set its own read function() to libpng using
png_set_read_fn(PNG_reader, file, png_my_read_data);
But CImg does not.
The solution is to built new version of the binaries for each supported Visual Studio version (2013 and 2015 in our case).
Moreover, we need to ship as well the debug version of those libraries, as libpng is incompatible between release and debug configurations (e.g you compile Sofa in debug and load it with libpng.dll, it will crash if you use libpng ; and vice-versa)
[ci-build]
Any news on this ?
Dependencies packages were updated, we are testing it with standard builds. And then we will launch new checks on this PR
Tests are here:
[ci-build]
If I'm right, the final question is where to place this CImgPlugin, right ?
[ci-build]
[ci-build]
[ci-build]
Still not ready, tests are failing. This is weird because tests are OK on my computer, at least for VS2015. (tried 64 and 32 bits)
I updated (again) the CI jobs to ensure new dependency packs are installed. I also launched a rebuild for Windows last builds.
[ci-build]
@fredroy it seems a problem due to the plugin appear (VS2013). Any idea of its origin?
This plugin allows us to load images using CImg API.
For now this plugin is located in applications/plugins of Sofa, and does not supersede ImageQt/ImagePNG/ImageBMP.
Tests and a simple scene to test all the supported formats are provided.
An other pull-request will be done to remove ImageQt/ImagePNG/ImageBMP and their posssible dependencies in SofaKernel (e.g libpng), following further discussions.
Linked to issue #51
This PR:
Reviewers will merge only if all these checks are true.