From 96909002d7aabe618947c57142ced808ab88d58a Mon Sep 17 00:00:00 2001 From: jbb01 <32650546+jbb01@users.noreply.github.com> Date: Tue, 6 Aug 2024 00:43:34 +0200 Subject: [PATCH] fix checksum of IEND chunk --- docs/cornell.png | Bin 1728585 -> 1728585 bytes docs/cornell_smoke.png | Bin 451823 -> 451823 bytes docs/simple.png | Bin 902498 -> 902498 bytes docs/squares.png | Bin 634703 -> 634703 bytes .../raytracing/render/ImageFormat.java | 3 ++- 5 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/cornell.png b/docs/cornell.png index 9eb79b953eda28b7712d1560233a5ad29476c561..0df23162fb23bfbc06befc2f861b78cfb070f250 100644 GIT binary patch delta 66 zcmV~$$qj%Y006h#_Q OqseTs{yy6`3T}S|#uNnr diff --git a/docs/cornell_smoke.png b/docs/cornell_smoke.png index d4e202c9af178ba56dc7441908f88a0618460134..2078917d382f7c7e5946966d022a7000c2d1f916 100644 GIT binary patch delta 26 icmaEVQu_T#>4p}@7N!>F7M2#)Eo`r!u&i@RXaWGB1`84p}@7N!>F7M2#)Eo`r!urL4t0Gmb$R{#J2 diff --git a/docs/simple.png b/docs/simple.png index 85b23129373c93c14af5c4bd2fc9c3ff7b6b9dbb..16e9e7c7c1569b8f1f549f0ab7ad447f13d23d34 100644 GIT binary patch delta 40 vcmaFVW&WtkyrG4$g{g(Pg{6hHg{_6Xg`F7M2#)7Pc1l7LF~P-s@S`IVCg!0N45p_y7O^ delta 32 mcmX?qPwo6YwT2eP7N!>F7M2#)7Pc1l7LF~P-s@QyfB*o~ItnHL diff --git a/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java b/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java index 6a92e53..c486dbb 100644 --- a/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java +++ b/src/main/java/eu/jonahbauer/raytracing/render/ImageFormat.java @@ -41,6 +41,7 @@ public enum ImageFormat { private static final int IHDR_TYPE = 0x49484452; private static final int IDAT_TYPE = 0x49444154; private static final int IEND_TYPE = 0x49454E44; + private static final int IEND_CRC = 0xAE426082; @Override public void write(@NotNull Canvas image, @NotNull OutputStream out) throws IOException { @@ -101,7 +102,7 @@ public enum ImageFormat { private void writeIEND(@NotNull Canvas image, @NotNull DataOutputStream data) throws IOException { data.writeInt(0); data.writeInt(IEND_TYPE); - data.writeInt(0); + data.writeInt(IEND_CRC); } private static class NoCloseDataOutputStream extends DataOutputStream {