Texture loading exception

I’m trying to map a png based texture on to geometry object. However, when I call setTexture method on assetManager I do get following error:



com.jme3.asset.AssetLoadException: Error occured while loading asset “compass.png (Flipped) (Mipmaped)” usingAWTLoader

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:245)

at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:290)

at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:309)

at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:321)

at com.widget.Compass.(Compass.java:58)

at com.Display3D.initializeWidgets(Display3D.java:161)

at com.Display3D.initialize(Display3D.java:153)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:117)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:188)

at java.lang.Thread.run(Thread.java:619)



I keep noticing that it says Flipped Mipmaped. I assume the problem comes from the way png file is being generated? What is more confusing is that my colleague runs it just fine on Mac, however I on Ubuntu 10.04 experience this issue.



Any comments appreciated.

Are you using OpenJDK or the sun JDK? You should be using the sun one.

I use sun

Maybe try re-saving the image with some linux image editor like gimp…



Edit: You can also try saving it with the built-in image editor of jMP under linux, it should hopefully create png’s that can be loaded again too as it uses the same java library for loading and saving…

I’ve been using gimp to create texture. Hm, is there properties I should be careful with saving images so they’d be jme3 compatible?

Can you try opening this png file on linux to see if it is correct?



My first guess would be that file got corrupted during transfer (newline problem). Png header is automatically detecting this, which would cause the error just like yours.

Fixed.



AssetLoader was trying to locate resources in a wrong resource.

zephyr said:
AssetLoader was trying to locate resources in a wrong resource.

What is that supposed to mean? You haven't just thrown all kinds of folders at the assetmanager to load from, have you?