mxgmn / WaveFunctionCollapse

Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics
Other
23.18k stars 1.24k forks source link

3Bricks.bmp is (slightly) corrupt (?) #22

Closed nanodeath closed 7 years ago

nanodeath commented 7 years ago

3Bricks.bmp opens fine in C# (Windows, CLR), opens fine in my editor (Paint.NET), but crashes and burns in Java:

Exception in thread "main" java.lang.RuntimeException: Failed while trying to read 3Bricks.bmp!
    at com.technicallyvalid.kollapse.Main.runOverlappingModel(Main.kt:74)
    at com.technicallyvalid.kollapse.Main.main(Main.kt:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.IndexOutOfBoundsException: off < 0 || len < 0 || off + len > b.length!
    at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:346)
    at com.sun.imageio.plugins.bmp.BMPImageReader.read8Bit(BMPImageReader.java:1160)
    at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:923)
    at javax.imageio.ImageIO.read(ImageIO.java:1448)
    at javax.imageio.ImageIO.read(ImageIO.java:1308)
    at com.technicallyvalid.kollapse.Main.runOverlappingModel(Main.kt:72)
    ... 6 more

Might be a damaged header or something. In any case, it'd be nice if someone could open and re-save 3Bricks.bmp in a trusted editor.

mxgmn commented 7 years ago

@nanodeath Yeah, I noticed that, I'll move everything into png today.

mxgmn commented 7 years ago

@nanodeath Is it corrupt now?

nanodeath commented 7 years ago

I won't be able to test until tonight (another 9 hours or so).

nanodeath commented 7 years ago

I've switched over to the PNGs and everything's working great. I'm going to resolve the issue.