diff --git a/docs/cornell.png b/docs/cornell.png index 0df2316..6623084 100644 Binary files a/docs/cornell.png and b/docs/cornell.png differ diff --git a/docs/cornell_smoke.png b/docs/cornell_smoke.png index 2078917..ef02b85 100644 Binary files a/docs/cornell_smoke.png and b/docs/cornell_smoke.png differ diff --git a/docs/diagramm.png b/docs/diagramm.png index 76290c1..29e0a57 100644 Binary files a/docs/diagramm.png and b/docs/diagramm.png differ diff --git a/docs/simple.png b/docs/simple.png index 16e9e7c..9f3091f 100644 Binary files a/docs/simple.png and b/docs/simple.png differ diff --git a/docs/squares.png b/docs/squares.png index 890dcb4..9e87af0 100644 Binary files a/docs/squares.png and b/docs/squares.png differ diff --git a/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java b/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java index c486dbb..caba497 100644 --- a/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java +++ b/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java @@ -1,6 +1,7 @@ package eu.jonahbauer.raytracing.render; import eu.jonahbauer.raytracing.render.canvas.Canvas; +import eu.jonahbauer.raytracing.render.canvas.Image; import org.jetbrains.annotations.NotNull; import java.io.*; @@ -10,6 +11,7 @@ import java.nio.file.Path; import java.util.zip.CRC32; import java.util.zip.CheckedOutputStream; import java.util.zip.DeflaterOutputStream; +import java.util.zip.InflaterInputStream; public enum ImageFormat { PPM { @@ -93,7 +95,7 @@ public enum ImageFormat { } var bytes = baos.toByteArray(); - data.writeInt(bytes.length); + data.writeInt(bytes.length - 4); // don't include type in length data.write(bytes); data.writeInt((int) crc.getChecksum().getValue()); }