[PR #5981] [MERGED] Ignore PNG chunk checksum errors in sprites, fonts and textures #6593

Closed
opened 2026-11-03 06:23:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5981
Author: @CayMac97
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/png-ignore-checksums-smp-packs


📝 Commits (2)

  • 065e7b8 Ignore PNG chunk checksum errors in sprites, fonts and textures
  • 8bde063 Effect textures ignore PNG chunk checksums too

📊 Changes

5 files changed (+40 additions, -0 deletions)

View changed files

📝 crates/horizon-client-input/src/window.rs (+1 -0)
📝 crates/horizon-client-render/src/biome.rs (+1 -0)
📝 crates/horizon-client-render/src/hud.rs (+35 -0)
📝 crates/horizon-client-render/src/post_chain.rs (+2 -0)
📝 crates/horizon-client-render/src/sprites.rs (+1 -0)

📄 Description

🤖 Opened by CayMac97's AI agent (Antigravity), not by CayMac97 personally.

What and why

Certain server resource packs (notably on SMP servers like HugoSMP using custom font sheets, item textures, and GUI elements) contain PNG files with invalid, non-standard, or stripped CRC-32 chunk checksums.

In vanilla Minecraft:

  • Textures, fonts, and GUI sprites are read via com.mojang.blaze3d.platform.NativeImage.read (STBImage.stbi_load_from_memory).
  • STB Image does not compute or fail on PNG chunk CRC-32 errors, allowing these textures to load transparently.

In Horizon:

  • png::Decoder calculates and verifies CRC-32/Adler-32 checksums by default, returning FormatError("CRC checksum mismatch").
  • When decoding fails, font sheets are skipped, rendering custom Unicode glyphs, GUI symbols, and scoreboard icons as missing character boxes [] [].

Configuring decoder.ignore_checksums(true) in hud::decode_bytes, sprites::read_rgba, biome::colormap, and window::icon matches vanilla behavior and allows custom font sheets and textures to load properly.

Fixes #5979.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

com.mojang.blaze3d.platform.NativeImage.read(InputStream) via org.lwjgl.stb.STBImage.stbi_load_from_memory.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on CayMac, against upstream/main at 81ae4a7d8)

Check Result
Scope ✅ 4 files, +38 −0
Cargo.lock ✅ unchanged
Public tree ✅ pass
Python tests ✅ 515 passed
tests: horizon-client-input, horizon-client-render ✅ 903 passed
doc tests ✅ 0 passed
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5981 **Author:** [@CayMac97](https://github.com/CayMac97) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/png-ignore-checksums-smp-packs` --- ### 📝 Commits (2) - [`065e7b8`](https://github.com/horizon-rust/horizon/commit/065e7b8efb17198a22231283a4497673aa990fed) Ignore PNG chunk checksum errors in sprites, fonts and textures - [`8bde063`](https://github.com/horizon-rust/horizon/commit/8bde063ed62dffdf40e1b9bded4b974662ee2b26) Effect textures ignore PNG chunk checksums too ### 📊 Changes **5 files changed** (+40 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-input/src/window.rs` (+1 -0) 📝 `crates/horizon-client-render/src/biome.rs` (+1 -0) 📝 `crates/horizon-client-render/src/hud.rs` (+35 -0) 📝 `crates/horizon-client-render/src/post_chain.rs` (+2 -0) 📝 `crates/horizon-client-render/src/sprites.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by CayMac97's AI agent (Antigravity), not by CayMac97 personally. ## What and why Certain server resource packs (notably on SMP servers like HugoSMP using custom font sheets, item textures, and GUI elements) contain PNG files with invalid, non-standard, or stripped CRC-32 chunk checksums. In vanilla Minecraft: - Textures, fonts, and GUI sprites are read via `com.mojang.blaze3d.platform.NativeImage.read` (`STBImage.stbi_load_from_memory`). - STB Image does not compute or fail on PNG chunk CRC-32 errors, allowing these textures to load transparently. In Horizon: - `png::Decoder` calculates and verifies CRC-32/Adler-32 checksums by default, returning `FormatError("CRC checksum mismatch")`. - When decoding fails, font sheets are skipped, rendering custom Unicode glyphs, GUI symbols, and scoreboard icons as missing character boxes `[] []`. Configuring `decoder.ignore_checksums(true)` in `hud::decode_bytes`, `sprites::read_rgba`, `biome::colormap`, and `window::icon` matches vanilla behavior and allows custom font sheets and textures to load properly. Fixes #5979. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `com.mojang.blaze3d.platform.NativeImage.read(InputStream)` via `org.lwjgl.stb.STBImage.stbi_load_from_memory`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on CayMac, against upstream/main at 81ae4a7d8) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +38 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ pass | | Python tests | ✅ 515 passed | | tests: horizon-client-input, horizon-client-render | ✅ 903 passed | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6593
No description provided.