Skip to content

[image] Expose readImageSize to python - #2212

Open
servantftransperfect wants to merge 1 commit into
developfrom
dev/pyReadImageSize
Open

servantftransperfect wants to merge 1 commit into
developfrom
dev/pyReadImageSize

Conversation

@servantftransperfect

Copy link
Copy Markdown
Contributor

Description

Python could not call image.readImageSize because it takes int& output arguments. This PR applies the SWIG int& OUTPUT typemap to width and height in image.i, so the call now looks like this:

width, height = image.readImageSize(path)

The readImageMetadata(path, width, height) overload has the same argument names, so it also becomes usable and returns (metadata, width, height).

Tests

  • Added test_read_image_size to pyTests/image/test_imageIO.py. It writes a 200x120 image and checks the size that is read back.
  • Not run locally. CI runs it with the other pyTests.

🤖 Generated with Claude Code

Map the int& width/height output parameters to python return values,
so readImageSize(path) returns (width, height).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant