mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:40:52 +01:00
[PR #2105] gallery: serve PNG thumbnails for textures saved as upper.DDS #2113
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2113
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2105
Author: @Tyrannys
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:gallery-uppercase-dds📝 Commits (4)
e3ac427gallery: serve PNG thumbnails for textures saved as upper.DDS831abc1gallery: the uppercase DDS test also keeps realpath from fixing the case64671a8gallery: the case-insensitive DDS sibling goes through safe_subpath2f06e1eMerge remote-tracking branch 'upstream/main' into gallery-uppercase-dds📊 Changes
2 files changed (+90 additions, -6 deletions)
View changed files
📝
tests/test_gallery.py(+65 -6)📝
tools/gallery.py(+25 -0)📄 Description
Claimed in the coordination issue as: GALLERY-THUMB-UPPERCASE-DDS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174150654)
What and why
From CrazyThiago's finding in the coordination issue:
tools/gallery.pyanswers/textures/<stem>.pngwith a PNG made from<stem>.ddswhen no PNG exists, but it only tried the lowercase.ddsname. On a case-sensitive filesystem a texture saved asupper.DDSis notupper.dds, so the catalog listed it and its thumbnail was a 404.When
<stem>.ddsis not a file, the handler now looks in the same folder for a file whose name matches it in any case (dds_sibling). The candidate is the pathsafe_subpathalready resolved inside the textures folder, and the sibling is in that same folder, so the containment guarantee is unchanged. A name that matches nothing in any case is still a 404.The regression test makes
os.path.isfilecase-sensitive and stopsos.path.realpathfrom correcting the name's case. On Windowsrealpathreturns the real case (upper.DDSforupper.dds), which is why a test that only patchedisfilepassed without the fix.Tested
python -I tests/test_gallery.py: 32 tests OK with the fix; onmain'stools/gallery.pythe new test fails (HTTP Error 404: Texture not found, 1 error of 32).python -I tests/test_text_write_line_endings.py: 3 tests OK.python -I scripts/check_no_game_data.py tools/gallery.py tests/test_gallery.py: clean.Run on Windows 11, Python 3.14.
GPUs tested: n/a (CPU-only Python tests)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.