heyanthony / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

can't load ICO assets from a JAR #637

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The cursor test in the test project has this exception. The file is in the 
jmonkey test assets in the textures.cursors but it is not getting copied over 
to the test project when it is created.

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,6,main]
com.jme3.asset.AssetLoadException: An exception has occured while loading 
asset: Textures/Cursors/nyancat.ico
    at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:290)
    at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:342)
    at jme3test.gui.TestCursor.simpleInitApp(TestCursor.java:53)
    at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
    at java.lang.Thread.run(Thread.java:744)
Caused by: javax.imageio.IIOException: Error reading PNG image data
    at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1308)
    at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
    at javax.imageio.ImageIO.read(ImageIO.java:1448)
    at javax.imageio.ImageIO.read(ImageIO.java:1352)
    at com.jme3.cursors.plugins.CursorLoader.parseICOImage(CursorLoader.java:515)
    at com.jme3.cursors.plugins.CursorLoader.loadCursor(CursorLoader.java:222)
    at com.jme3.cursors.plugins.CursorLoader.load(CursorLoader.java:87)
    at com.jme3.cursors.plugins.CursorLoader.load(CursorLoader.java:57)
    at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:288)
    ... 6 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
    at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
    at java.io.DataInputStream.readFully(DataInputStream.java:195)
    at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1092)
    at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1196)
    at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1301)
    ... 14 more

Original issue reported on code.google.com by davisrol...@gmail.com on 16 Mar 2014 at 12:04

GoogleCodeExporter commented 8 years ago
For some reason, even though the tests project is referencing the test-data jar 
file as a library, it is not able to use data from it, and this kind of problem 
is present in a lot of tests. I'm trying to work out how to solve this.

Original comment by davisrol...@gmail.com on 16 Mar 2014 at 1:46

GoogleCodeExporter commented 8 years ago
Note that mem.cur and monkey.ani cursors load successfully, so this issue is 
probably specific to the .ico extension or perhaps this file.

Original comment by sg...@sonic.net on 20 Mar 2014 at 1:44

GoogleCodeExporter commented 8 years ago
Testing revealed that ICO files which load fine in the IDE do not load from JAR 
files. This was enough of a clue that PSpeed was able to spot the bug in 
CursorLoader.java and provide a fix.  The bug is present in both trunk and 
3.0.5 version. I've tested the fix and will post the code for review. 

Original comment by sg...@sonic.net on 20 Mar 2014 at 6:52

GoogleCodeExporter commented 8 years ago
fixed in trunk: https://code.google.com/p/jmonkeyengine/source/detail?r=11107

fixed in gradle-restructure: 
https://code.google.com/p/jmonkeyengine/source/detail?r=11106

Original comment by sg...@sonic.net on 20 Mar 2014 at 8:18