CImg<float>* img = NULL;
bool loaded;
while ( !loaded )
{
loaded = true;
try
{
img = &CImg<float>( filename );
}
catch ( CImgException )
{
loaded = false;
fprintf( stdout, "ERROR: could not load %smap file.\n", mapname );
}
}
When I enter a valid image filename that CImg is able to find and read, img.width() and img.height() both return -858993460. According to the documentation, img.width()'s return type is int, but the value if fetches is img._width, an unsigned int.