Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

tools: Steam screenshot dimensions preflight (refs #45) (#187)

agamrafaeli-instinct244ccbacd894
diff --git a/tools/README.md b/tools/README.md
index ab1ab8d21..a5208aec8 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -81,3 +81,18 @@ Copernicus notice.
`ASSETS.yaml` and `ASSETS.portraits.yaml`. It groups only explicit `ai_generated: true` rows by media kind,
keeps source/status and manifest names, and includes the README's no-live-generation statement. It does not
change flags, clear licences, expand asset patterns into filenames, or answer the store content survey.
+
+## Steam screenshot dimensions (#45)
+
+Before the owner reviews a proposed set of store screenshots, run:
+
+```bash
+uv run tools/store_screenshots.py path/to/shot1.png path/to/shot2.png path/to/shot3.png path/to/shot4.png path/to/shot5.png
+```
+
+This refuses unreadable images, fewer than five distinct paths, dimensions below 1920 x 1080, or a non-16:9 ratio.
+Repeated paths do not satisfy the count. It does not compare image contents: copies at different paths can still pass.
+`DIMENSIONS OK` is not proof of real gameplay, rights, age suitability or store acceptance. The owner still reviews
+what each screenshot shows and records the build commit/zip SHA-256 and capture date. This does not capture anything,
+change a release gate or submit a store page. Steam's [official screenshot requirements](https://partner.steamgames.com/doc/store/assets/standard)
+were checked 11 October 2026; re-check before submission. These are not itch.io requirements.
diff --git a/tools/store_screenshots.py b/tools/store_screenshots.py
new file mode 100644
index 000000000..a391dd56d
--- /dev/null
+++ b/tools/store_screenshots.py
@@ -0,0 +1,56 @@
+# /// script
+# requires-python = ">=3.11"
+# dependencies = ["pillow==12.3.0"]
+# ///
+"""#45: check a proposed Steam screenshot set's count/dimensions, not its contents.
+
+Usage: uv run tools/store_screenshots.py path/to/shot1.png ... path/to/shot5.png
+At least five different paths, minimum 1920 x 1080 and exact 16:9.
+This cannot establish real gameplay, rights, age suitability or store approval.
+Steam source checked 2026-10-11: https://partner.steamgames.com/doc/store/assets/standard
+"""
+import argparse
+from pathlib import Path
+from PIL import Image, UnidentifiedImageError
+
+
+def validate(paths):
+ errors, unique = [], set()
+ for path in paths:
+ p = Path(path)
+ resolved = p.resolve()
+ if resolved in unique:
+ errors.append(f'{p}: duplicate path (does not count as another screenshot)')
+ continue
+ unique.add(resolved)
+ try:
+ with Image.open(p) as image:
+ width, height = image.size
+ image.verify()
+ except (OSError, ValueError, UnidentifiedImageError) as exc:
+ errors.append(f'{p}: cannot read image ({exc})')
+ continue
+ if width < 1920 or height < 1080:
+ errors.append(f'{p}: {width} x {height}, minimum 1920 x 1080 required')
+ if width * 9 != height * 16:
+ errors.append(f'{p}: {width} x {height}, 16:9 required')
+ if len(unique) < 5:
+ errors.append(f'at least 5 distinct screenshot paths required; got {len(unique)}')
+ return errors
+
+
+def main(argv=None):
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('images', nargs='*', type=Path)
+ args = parser.parse_args(argv)
+ errors = validate(args.images)
+ if errors:
+ for error in errors:
+ print('DIMENSIONS REFUSED: ' + error)
+ return 1
+ print('DIMENSIONS OK: count and image dimensions only, not gameplay provenance, rights or age suitability')
+ return 0
+
+
+if __name__ == '__main__':
+ raise SystemExit(main())
diff --git a/tools/tests/test_store_screenshots.py b/tools/tests/test_store_screenshots.py
new file mode 100644
index 000000000..18485891d
--- /dev/null
+++ b/tools/tests/test_store_screenshots.py
@@ -0,0 +1,55 @@
+"""#45: dimensions/count checks are not a gameplay-provenance verdict."""
+import importlib.util
+from pathlib import Path
+from PIL import Image
+ROOT = Path(__file__).resolve().parents[2]
+
+
+def module():
+ spec = importlib.util.spec_from_file_location('store_screenshots', ROOT / 'tools/store_screenshots.py')
+ m = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(m)
+ return m
+
+
+def shots(tmp_path, count=5, size=(1920, 1080)):
+ paths = []
+ for i in range(count):
+ p = tmp_path / f'{i}.png'
+ Image.new('RGB', size).save(p)
+ paths.append(p)
+ return paths
+
+
+def test_five_widescreen_images_pass_and_four_fail(tmp_path):
+ m = module()
+ paths = shots(tmp_path)
+ assert m.validate(paths) == []
+ assert any('at least 5' in e for e in m.validate(paths[:4]))
+
+
+def test_smaller_readme_shot_and_wrong_ratio_fail(tmp_path):
+ m = module()
+ paths = shots(tmp_path)
+ Image.new('RGB', (1568, 752)).save(paths[0]) # the README build shots (docs/images/build-m3-*.jpg)
+ errors = m.validate(paths)
+ assert any('1920 x 1080' in e and '0.png' in e for e in errors)
+ Image.new('RGB', (1920, 1200)).save(paths[0])
+ assert any('16:9' in e for e in m.validate(paths))
+
+
+def test_duplicate_paths_do_not_meet_count_and_bad_file_is_named(tmp_path):
+ m = module()
+ paths = shots(tmp_path)
+ assert any('duplicate' in e for e in m.validate([paths[0]] * 5))
+ paths[0].write_text('not an image')
+ assert any('cannot read' in e and '0.png' in e for e in m.validate(paths))
+
+
+def test_cli_pass_is_explicitly_limited(tmp_path, capsys):
+ m = module()
+ assert m.main([str(p) for p in shots(tmp_path)]) == 0
+ out = capsys.readouterr().out
+ assert 'DIMENSIONS OK' in out
+ assert 'not gameplay provenance' in out
+ assert m.main([]) == 1