image - ImageIO no suitable reader in Java web start -
i have java web start application shows png images loaded with:
inputstream = aclass.class.getclassloader().getresourceasstream(“icon/tray.png”); imageio.read(is);
while works eclipse doesn’t work when run application java web start. difference in both setups in java web start image loaded jar file while in eclipse images comes directly file system.
what happens in java web start is, inputstream gets created expected (meaning resource can loaded) but, far can see it, within imageio.read() method no suitable reader can found image in stream , imageio.read() returns null. how can reader can found when starting eclipse not if started java web start?
furthermore got more png’s loaded mechanisms javafx more precisely via css e.g.
-fx-image: url('icon/settings_general_32x32.png');
i see same behavior here too. works eclipse not java web start although i’m not sure if because of same reason or reason guess because of missing reader too.
so looked in code of pngimagereaderspi , there 1 can see in method candecodeinput() first 8 byte of stream analyzed decide if png reader can decode image or not. had @ first 8 bytes of image stream when starting eclipse , when starting java web start , indeed there difference. when running eclipse first bytes -119,80,78,71,13,10,26,10 , in java web start first bytes -17,-65,-67,80,78,71,13,10. me looks @ least little strange, i’m not sure if cause of problem.
has come across problem? did miss anything? or ideas highly appreciated.
as writen in comment images currupted applications build script. reason why not working java web start working eclipse build script not used.
Comments
Post a Comment