GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Refresh image dimensions after quarter-turn rotations by antonsoo · Pull Request #194 · libtcod/python-tcod

Conversation

@antonsoo

@antonsoo antonsoo commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Image.rotate90() updates native pixels but leaves the Python width and height unchanged. For a rectangular image, np.asarray(image) consequently returns the rotated pixels with the old shape.

Refresh the dimensions from the native image after rotating. Regressions cover rectangular and square images, signed/full turn counts, and repeated quarter turns.

A photograph-based array-to-semigraphics workflow matches NumPy rotation and a separately rendered reference console after the fix. Before, 20 of 54 configurations produced incorrect images and 30,720 differing console tiles; all 34 unaffected configurations remain identical.

Validation: 11 regressions fail before and all 28 pass after. The full native --no-window suite passes 309 tests with 95 rendering skips; applicable hooks and two-file Mypy pass. Tested on Linux/Python 3.12.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@antonsoo
Refresh image dimensions after quarter-turn rotations
86afe21
@codecov

codecov Bot commented Oct 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.08%. Comparing base (432932a) to head (86afe21).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #194   +/-   ##
=======================================
  Coverage   86.08%   86.08%           
=======================================
  Files          29       29           
  Lines        7589     7590    +1     
=======================================
+ Hits         6533     6534    +1     
  Misses       1056     1056           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

HexDecimal
HexDecimal approved these changes Oct 12, 2026
View reviewed changes

@HexDecimal HexDecimal left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I never gave the libtcod image port the scrutiny it deserved. It was a mistake for me to port it like this, and naturally I only tested rotation on a square image.

Thanks for fixing this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HexDecimal
HexDecimal merged commit 51e4832 into libtcod:main Oct 12, 2026
31 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@HexDecimal HexDecimal HexDecimal approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@antonsoo @HexDecimal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.