title: OGRE EXCEPTION(7:InternalErrorException): Error decoding image in FreeImageCodec::decode at
body: <p>I'm using <strong>Ogre 3D 1.9</strong>, and I'm trying to load a mesh contained in a folder pointed by the resource.cfg file. The folder contains sub-folders, that separate the .mesh files, .material files and textures. Here's the content of the <strong>resource.cfg</strong> file: </p>
  
  <pre><code># Resources required by the sample browser and most samples.
  [Essential]
  
  
  # Resource locations to be added to the default path
  [General]
  FileSystem=media
  FileSystem=media/materials/scripts
  FileSystem=media/materials/textures
  FileSystem=media/models
  </code></pre>
  
  <p>After this i declare and initialize the mesh, materials and textures with the following:</p>
  
  <pre><code>Ogre::ResourceGroupManager::getSingleton().declareResource("ram.mesh", "Mesh", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::NameValuePairList());
  Ogre::ResourceGroupManager::getSingleton().declareResource("char_ram_col.png", "Font", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::NameValuePairList());
  Ogre::ResourceGroupManager::getSingleton().declareResource("char_ram_nor.png", "Font", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::NameValuePairList());
  Ogre::ResourceGroupManager::getSingleton().declareResource("ram_skin.material", "Material", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::NameValuePairList());
  Ogre::ResourceGroupManager::getSingleton().declareResource("ram_skin_eyelids.material", "Material", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::NameValuePairList());
  Ogre::ResourceGroupManager::getSingleton().declareResource("ram_skin_eyes.material", "Material", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::NameValuePairList());
  Ogre::ResourceGroupManager::getSingleton().declareResource("ram_skin_horns.material", "Material", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::NameValuePairList());
  
  Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
  </code></pre>
  
  <p>Then i attach the mesh to a node:</p>
  
  <pre><code>Ogre::Entity *entity = scene-&gt;createEntity("LocalMesh_Ent", "ram.mesh");
  Ogre::SceneNode *cube = node-&gt;createChildSceneNode("ram.mesh", Ogre::Vector3(x, y, z));
  cube-&gt;attachObject(entity);
  </code></pre>
  
  <p>where cube is a SceneNode previously created.</p>
  
  <p>I have problem loading the texture. The code is build without any problem, but when i run it i have the following error (in the log file):</p>
  
  <pre><code>OGRE EXCEPTION(7:InternalErrorException): Error decoding image in FreeImageCodec::decode at ..\..\..\..\OgreMain\src\OgreFreeImageCodec.cpp (line 419)
  </code></pre>
  
  <p>The mesh and the materials are created correctly, if for example i comment the part regarding the texture.</p>
  
  <p>Does anybody know which could be the problem ?</p>
  
  <p><strong>Second question</strong>: i read that the .png file has to be declared as Font, but there's also the Texture option (which doesn't work as well). Is that correct ?</p>