Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken ImageRescaleWrapper due to PIL's resize() change. #220

Merged
merged 1 commit into from
Jul 14, 2024

Conversation

copybara-service[bot]
Copy link

Fix broken ImageRescaleWrapper due to PIL's resize() change.

PIL 10.4.0's Image.resize() behavior causes a breakage in
ImageRescaleWrapper due to the way numpy arrays are compared. In particular,
in 10.3.0 the size argument was cast to a tuple, but not in 10.4.0 (see
changes).
This has since been
reinstated,
but it did not make it to the 10.4.0 release.

We can still change our code though, so we now simply pass a tuple instead of
an np.array.

@copybara-service copybara-service bot force-pushed the test_651877307 branch 3 times, most recently from 35d5941 to 28cefb3 Compare July 14, 2024 00:13
PIL 10.4.0's `Image.resize()` behavior causes a breakage in
`ImageRescaleWrapper` due to the way numpy arrays are compared. In particular,
in 10.3.0 the `size` argument was cast to a `tuple`, but not in 10.4.0 (see
[changes](python-pillow/Pillow@10.3.0...10.4.0)).
This has since been
[reinstated](python-pillow/Pillow@936012e),
but it did not make it to the 10.4.0 release.

We can still change our code though, so we now simply pass a `tuple` instead of
an `np.array`.

PiperOrigin-RevId: 652127278
@copybara-service copybara-service bot merged commit c109b8c into main Jul 14, 2024
@copybara-service copybara-service bot deleted the test_651877307 branch July 14, 2024 00:15
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.

1 participant