This one has me a little stumped! I have 1 texture in my project which fails to load. I am using Monogame 3.2 and the XNA content pipeline. This issue only started happening when I ran my game on a Motorola Droid Razr (Android 4.1.1) emulator. It runs fine on a Galaxy S4 (Android 4.4) emulator. (those are the only two versions I have tried)
The image in question:
I get the usual content error:
Microsoft.Xna.Framework.Content.ContentLoadException: Could not load Sprites\UI\InGame\winner01_black asset as a non-content file! ---> System.Exception: Opening stream error.
Every other texture in the game loads fine, so I assumed I did something silly with this particular texture but things got really weird as I tried to narrow it down.
Here is what I have tried and the results:
1) Overwriting broken PNG with a PNG that I know works (to verify path and stuff is working), running it through the Content Pipeline, and loading it in game. WORKS
2) Resaving broken texture from Gimp/Paint.NET (in case I had some bad settings or something), running it through the Content Pipeline, and loading it in game BROKEN
3) In Gimp, copy and paste the broken image into a whole new file, saved that new file, ran it through the Content Pipeline, and loaded it in game. BROKEN
4) Made some arbitrary changes to the broken image (drawing lines all over it - see image below) re-saved, ran it through the Content Pipeline, and loaded it in game. WORKS
5) I then made some really minor changes to the broken image (adding a single red pixel), ran it through the Content Pipeline, and loaded it in game. BROKEN
6) Re-saved the broken PNG as a TGA, ran it through the Content Pipeline, and loaded it in game. BROKEN
At this point it seems to me that the Content Pipeline must be doing some sort of optimization to the image (someone suggested it maybe be turning it into a palatalized lookup since there are so few colors and would explain why #4 worked).
I have put the two versions of the PNG (and resulting XNB) here hoping that someone might be able to tell me what would cause one to fail to load and the other work!
https://www.dropbox.com/sh/vqegeozqf6hv2uz/AACVoj6sEzFVW-PI6lgwdvzAa?dl=0
I ended up just reducing the image to remove most of the empty area (where alpha = 0) and that somehow fixed the issue for me. I suspect the content pipeline treated the image differently when there was a lot of empty space.