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

Ensure PIL.Image.resize() always gets a tuple size #2248

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions trimesh/visual/gloss.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ def get_specular_glossiness(

if diffuseTexture is not None and specularGlossinessTexture is not None:
# reshape to the size of the largest texture
max_shape = [
max_shape = tuple(
max(diffuseTexture.size[i], specularGlossinessTexture.size[i])
for i in range(2)
]
)
if (
diffuseTexture.size[0] != max_shape[0]
or diffuseTexture.size[1] != max_shape[1]
Expand Down
2 changes: 1 addition & 1 deletion trimesh/visual/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ def pack_images(images):
scale = max_tex_size.max() / max_tex_size_individual
max_tex_size = np.round(max_tex_size / scale).astype(np.int64)

unpadded_sizes.append(max_tex_size)
unpadded_sizes.append(tuple(max_tex_size))

# use the same size for all of them to ensure
# that texture atlassing is identical
Expand Down
2 changes: 1 addition & 1 deletion trimesh/visual/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,6 @@ def power_resize(image, resample=1, square=False):

# if we're not powers of two upsize
if (size != new_size).any():
return image.resize(new_size, resample=resample)
return image.resize(tuple(new_size), resample=resample)

return image.copy()
Loading