PDA

View Full Version : NoDecodeDelegateForThisImageFormat loading texture Assimp/ImageMagick



RaenirSalazar
07-20-2014, 06:01 PM
I am trying to use ImageMagick to load a Mesh's (made in Blender) texture from using the ASSIMP library. The Mesh has a single material and a single texture.

I was attempting to follow two tutorials: Tutorial38 (http://ogldev.atspace.co.uk/www/tutorial38/tutorial38.html) and Tutorial22 (http://ogldev.atspace.co.uk/www/tutorial38/tutorial22.html).

The below code block is where it has problems;



bool Texture::Load()
{
try {
m_pImage = new Magick::Image(m_fileName); /* RIGHT HERE IT OCCURS */
m_pImage->write(&m_blob, "RGBA");
}
catch (Magick::Error& Error) {
std::cout << "Error loading texture '" << m_fileName << "': " << Error.what() << std::endl;
return false;
}

glGenTextures(1, &m_textureObj);
glBindTexture(m_textureTarget, m_textureObj);
glTexImage2D(m_textureTarget, 0, GL_RGBA, m_pImage->columns(), m_pImage->rows(), 0, GL_RGBA, GL_UNSIGNED_BYTE, m_blob.data());
glTexParameterf(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

return true;
}


It almost immediately exits the Try-Catch with the current error:

"Error loading texture, 'Resources/white.png': myproject.exe: NoDecodeDelegateForThisImageFormat 'Resources/white.png' error/constitute.c/ReadImage/550

As far as I can determine ImageMagick is installed properly, I've attempted numerous times to compile it by hand but I always end up with Unresolved External errors with the new libs (they seem to be 2-3 mb bigger than the ones included with the Project).

The versions attempted:

ImageMagick-6.6.5-10
ImageMagick-6.6.0
ImageMagick-6.8.9
ImageMagick-windows zip from their instructions page.

A big problem I have when attempting the self installer binaries is that they don't include both the Release Candidate AND the Debug lib's, when the code requires both; while the source versions I compile as mentioned aren't correct and result in Unresolved External errors or don't otherwise clearly deposit their Include and Lib folders.

I've contacted the developer of the tutorial but the only thing he's said so far is that I might have the wrong version of ImageMagick installed and is incompatible with the version he includes... Without saying which version the correct one would be.

RaenirSalazar
07-20-2014, 08:30 PM
Solved it, had to switch the compiler to Release mode.