I was thinking it was my fault but making a much more simplier code it still fails:
FIBITMAP* infloat = FreeImage_ConvertToRGBF(bitmap);
FreeImage_Save(fifpng, bitmap, "D:\\orig.png", 0); //THIS WORKS OK
FreeImage_Save(fifexr, infloat, "D:\\justTest.exr", 0); //THIS WORKS OK
FIBITMAP *pImage = FreeImage_ConvertTo24Bits(infloat);
if (pImage == NULL)
printf("CONVERSION FAILED\n");
It failed in FreeImage_ConvertTo24Bits and FreeImage_ConvertTo32Bits but I cannot imagine why since infloat seems to be ok and bitmap is ok too.
Notice that if I make: FIBITMAP *pImage = FreeImage_ConvertTo24Bits(bitmap);
it works ok too.
Any help is welcome!