Jump to content

  • Log In with Google      Sign In   
  • Create Account


DevIL ilLoadImage/iLoad failure


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 kilah   Members   -  Reputation: 391

Like
0Likes
Like

Posted 28 June 2010 - 11:48 PM

Hi all,

I am posting as I am unable to find the problem myself nor on the internet. I hope someone can enlighten me a bit on this issue.

I am trying to load images using DevIL as loading library ( Freeimage is an option I have in mind, yet I like DevIL style ).

My DevIL code is as follows:


ilGenImages( textures.size(), ilTexID);
[...]
ilBindImage( ilTexID[i] );

std::wstring fn( textures[i].length(), L'' );
std::copy( textures[i].begin(), textures[i].end(), fn.begin() );

if( ilLoadImage( fn.c_str() ) ) {
// WE NEVER ENTER THIS IF
}
ilDeleteImages( textures.size(), ilTexID);

NOTE: ilInit is done a way early on in the process.

The problem I am facing is that ilLoadImage(...) always return IL_INVALID_EXTENSION and when trying instead ilLoad( ... ) and specifying the image format I get a IL_COULD_NOT_OPEN_FILE. If I use ilLoadF(...), I get a segmentation fault, yet the FILE* is correct (tested by asking a ftell after a fseek(...,SEEK_END) for a file size ), thus confirming that the file address is right.

Anyone has a hint on this issue?

Regards

EDIT: Several formats have been tested, JPG, BMP, TGA...all of them failing.

[Edited by - kilah on June 29, 2010 6:06:36 AM]

Sponsor:

#2 Bryn   Members   -  Reputation: 100

Like
0Likes
Like

Posted 23 September 2011 - 11:52 AM

Make sure that you are using the Unicode dlls if you're passing in a wchar_t*. I just fixed a problem where I moved my project over to Unicode, and ilLoadImage started failing.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS