Skip to content

Fix image rendering for tiles with negative indices (e.g. X0084_Y-013) - #12

Merged
vudongpham merged 1 commit into
mainfrom
claude/tile-negative-coords-image-2xdx62
Nov 12, 2026
Merged

vudongpham merged 1 commit into
mainfrom
claude/tile-negative-coords-image-2xdx62

Conversation

@vudongpham

Copy link
Copy Markdown
Owner

Problem

Clicking a point in a tile with a negative index, e.g. X0084_Y-013, did not render the image.

FORCE zero-pads tile indices to 4 characters including the sign (f"{-13:04d}" == "-013", which utils.locate also uses), so a negative index has only 3 digits. TILE_NAME in forcelive/overlay.py required 4 digits after the minus (-?\d{4}), so check_tile rejected these tiles with "Invalid tile name" and the overlay request failed.

Fix

  • TILE_NAME now accepts \d{4,} or -\d{3,} for each axis. It still rejects path-like or malformed names.
  • Added test_check_tile_negative_index, which covers valid negative and positive names and malformed or traversal names.

All 30 tests pass.


Generated by Claude Code

FORCE zero-pads tile indices to 4 characters including the sign, so a
negative index has 3 digits (-013). The tile-name regex required 4 digits
after the minus, rejecting these tiles and leaving the image unrendered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUYE7hae8nSVArW4MDodWh
@vudongpham
vudongpham merged commit 7f497ca into main Nov 12, 2026
2 checks passed
@vudongpham
vudongpham deleted the claude/tile-negative-coords-image-2xdx62 branch November 12, 2026 12:44
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.

2 participants