Skip to content

Commit

Permalink
fix possible overflow in color_mask
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed Aug 17, 2024
1 parent 8c0744a commit a6e9796
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pil_utils/build_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def color_mask(self, color: ColorType) -> "BuildImage":
rgb_sum = sum(color)
for i in range(h):
for j in range(w):
value = img_gray[i, j]
value = int(img_gray[i, j])
new_color = (
[
int(value * r / rgb_sum),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pil-utils"
version = "0.1.11"
version = "0.1.12"
description = "A simple PIL wrapper and text-to-image tool"
authors = ["meetwq <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit a6e9796

Please sign in to comment.