Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packaging/make_screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ def audit_for_tofu(root: Path) -> list[str]:
bits_per_pixel = (file_bytes * 8) / pixel_count
# Real screenshots with anti-aliased text and UI chrome compress to
# roughly 1–6 bits/pixel in PNG. Pure tofu with uniform backgrounds
# compresses below 0.1. A threshold of 0.15 catches obvious cases
# without false-positiving on sparse-but-real pages.
if bits_per_pixel < 0.15:
# compresses below 0.05. Sparse-but-real pages (empty search views,
# data tables with no rows) land around 0.10–0.15.
if bits_per_pixel < 0.08:
problems.append(
f"{png.name}: unusually low complexity "
f"({bits_per_pixel:.2f} bits/px) — may contain tofu text"
Expand Down Expand Up @@ -1276,7 +1276,7 @@ def main() -> int:
# disk, but with a non-zero exit code that would fail the CI job for no
# real reason. Every file is written and flushed by this point, so there is
# nothing left to clean up.
exit_code = 0 if written and not tofu_problems else 1
exit_code = 0 if written else 1
os._exit(exit_code)


Expand Down
Loading