This has been frustrating me for the past hour… :cranky: I’m simply trying to read a PNG file into a Pixmap object:
void buildLevel(String mapFile){
Pixmap pm = PixmapIO.readCIM(Gdx.files.internal("data/"+mapFile));
// other stuff
But I get the following error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't read Pixmap from file 'data/level1.png'
at com.badlogic.gdx.graphics.PixmapIO$CIM.read(PixmapIO.java:136)
at com.badlogic.gdx.graphics.PixmapIO.readCIM(PixmapIO.java:48)
at com.me.itlogap.LogapLevel.buildLevel(LogapLevel.java:125)
at com.me.itlogap.LogapLevel.<init>(LogapLevel.java:49)
at com.me.itlogap.ItLoGaP.render(ItLoGaP.java:356)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:202)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:110)
Caused by: java.util.zip.ZipException: incorrect header check
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.io.DataInputStream.readInt(Unknown Source)
at com.badlogic.gdx.graphics.PixmapIO$CIM.read(PixmapIO.java:115)
... 7 more
I created the png file with GraphicsGale. I even ran pngcrush on it with the -new option to try and clean any formatting stuff that might be messing up the file i/o… but to no avail. Any idea how to solve this?