Could not create WIC Decoder from filename

Hi

I am creating an application in which I am storing textures in a texture vector and creating a slideshow of those images. When it runs for first time it runs fine but when I recall the function to fill the vector with new images it gives me exception “Could not create WIC Decoder from filename” while loading images to form image texture.

for (int i = 0; i < limit; i++)
{
    gl::TextureRef	mImg = gl::Texture::create(loadImage(loadAsset(imgPath)));
    mImages.push_back(mImg);
 }

What kind of files are you trying to load? Do they have proper file extensions (.png, .jpg, .jpeg)?

Just a wild guess, but I’ve run into some issues like this when the first time i’ve tried to use the image loading system has been from a secondary thread. I’ve had to load a dummy image on the main thread first, and then kick off my threaded loader after that.

I am using .jpg files @paul.houx

I think the best thing to do in these cases is to try to make a minimal app (like from tinderbox) and try to reproduce the issue in that. Many times you’ll stumble on the issue that way, or you’ll find out there is a real problem and you can post that code so others can reproduce / diagnose.

1 Like

are you loading the same jpg file * limit times?