Skip to content

gallery: list JPEG and WebP textures with their actual formats - #5527

Merged
shayderrr merged 1 commit into
ItsNotRexed:mainfrom
Solthodox:draft/gallery-texture-formats
Nov 23, 2026
Merged

shayderrr merged 1 commit into
ItsNotRexed:mainfrom
Solthodox:draft/gallery-texture-formats

Conversation

@Solthodox

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: new gallery-texture-formats item.

What and why

The gallery previously advertised .jpg and .webp as PNG and omitted .jpeg. Use the same extension table for catalog entries and automatic texture-directory selection. JPEG and WebP previews still use their direct URLs.

Test merge with #4529 was clean.

Tested

Linux x86_64, CPython 3.12.13, synthetic inputs; no GPU or driver test. The HTTP regression failed on the base for all three input names. python3.12 -I tests/test_gallery.py: 4 passed. In Chromium the gallery displayed generated review.jpeg as “JPEG Image” and review.webp as “WebP Image”.

AI-assisted: yes (Codex).

Checklist

  • No game data, keys, or decryption.
  • No shader translator rule changed; the translator contract checklist does not apply.

Use one extension table for indexing and directory discovery; include both JPEG suffixes and retain direct preview URLs.

Verified on Linux x86_64 with Python 3.12.13: python3.12 -I tests/test_gallery.py (4 passed). Synthetic inputs; no game data or GPU test.
AI-assisted.

@kacper-serewis kacper-serewis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted independent review. At b28f4e4 the Windows HTTP catalog labeled all four mixed-case JPEG/WebP fixtures correctly, selected their directory over one with three PNGs, and returned correct MIME types and exact bytes. The private integration with #4529 did likewise. Browser decoding was outside the test.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at head b28f4e454 (draft; Windows 11).

Commands:

python -I -m pytest tests/test_gallery.py -q
git diff --check 3faac557b..HEAD

Results: 4 passed, 3 subtests; diff --check clean.

One TEXTURE_FORMATS table now feeds both the catalog entry and the automatic texture-directory choice, so .jpeg is listed (previously omitted) and .jpg/.jpeg/.webp report "JPEG Image"/"WebP Image" instead of "PNG Image"; DDS preview substitution is unchanged.

Verdict: approve.

@Solthodox
Solthodox marked this pull request as ready for review November 23, 2026 12:20
@dukefissura

Copy link
Copy Markdown
Contributor

Tested b28f4e4 merged onto main 561b65a (Linux, Python 3.13, no game files): it merges cleanly and tests/test_gallery.py passes 20/20. The new test_texture_catalog_labels_jpeg_and_webp fails 3 subtests against main's tools/gallery.py (sky.JPG, road.jpeg, tree.webp) and passes with the change, so it covers the bug.

Code read: one TEXTURE_FORMATS table now drives the listing filter, the format label and the auto-detect count, so .jpeg is listed and counted consistently. Non-DDS files keep their own path as the preview, and mimetypes serves them as image/jpeg and image/webp. Looks good to me. AI-assisted (Claude).

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed change in PR #5527: gallery: list JPEG and WebP textures with their actual formats.

Scope: tests/test_gallery.py, tools/gallery.py
Diff: +28 / -6 across 2 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @Solthodox - I went through gallery: list JPEG and WebP textures with their actual formats and the diff around tests/test_gallery.py. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

@shayderrr
shayderrr merged commit 5a602e8 into ItsNotRexed:main Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants