Skip to content

Commit

Permalink
[bug] Relax dependent Pillow version (#6170)
Browse files Browse the repository at this point in the history
Fixes #6032

### Brief Summary
see issue above
  • Loading branch information
ailzhang authored Sep 28, 2022
1 parent 1a1819f commit 849be97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions python/taichi/lang/_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def from_image(self, image):
assert self.num_dims == 2
assert self.dtype == u8
assert self.num_channels == 4
image = image.transpose(Image.Transpose.ROTATE_90)
# Don't use transpose method since its enums are too new
image = image.rotate(90, expand=True)
arr = np.asarray(image)
from taichi._kernels import \
load_texture_from_numpy # pylint: disable=import-outside-toplevel
Expand All @@ -181,4 +182,4 @@ def to_image(self):
from taichi._kernels import \
save_texture_to_numpy # pylint: disable=import-outside-toplevel
save_texture_to_numpy(self, res)
return Image.fromarray(res).transpose(Image.TRANSPOSE.ROTATE_270)
return Image.fromarray(res).rotate(270, expand=True)
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pillow>=9.1.0
Pillow
pytest
pytest-xdist
pytest-rerunfailures
Expand Down

0 comments on commit 849be97

Please sign in to comment.