Skip to content

Commit

Permalink
Format with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Oct 15, 2021
1 parent 43fac1c commit ca40889
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
4 changes: 1 addition & 3 deletions Tests/test_file_webp.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ def test_background_from_gif(self, tmp_path):

with Image.open(out_gif) as reread:
reread_value = reread.convert("RGB").getpixel((1, 1))
difference = sum(
abs(original_value[i] - reread_value[i]) for i in range(0, 3)
)
difference = sum(abs(original_value[i] - reread_value[i]) for i in range(0, 3))
assert difference < 5

@skip_unless_feature("webp")
Expand Down
8 changes: 2 additions & 6 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,12 +943,8 @@ def convert_transparency(m, v):
transparency = convert_transparency(matrix, transparency)
elif len(mode) == 3:
transparency = tuple(

convert_transparency(
matrix[i * 4 : i * 4 + 4], transparency
)
for i in range(0, len(transparency))

convert_transparency(matrix[i * 4 : i * 4 + 4], transparency)
for i in range(0, len(transparency))
)
new.info["transparency"] = transparency
return new
Expand Down
12 changes: 5 additions & 7 deletions src/PIL/ImageDraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,11 @@ def coord_at_angle(coord, angle):
angle -= 90
distance = width / 2 - 1
return tuple(

p + (math.floor(p_d) if p_d > 0 else math.ceil(p_d))
for p, p_d in (
(x, distance * math.cos(math.radians(angle))),
(y, distance * math.sin(math.radians(angle))),
)

p + (math.floor(p_d) if p_d > 0 else math.ceil(p_d))
for p, p_d in (
(x, distance * math.cos(math.radians(angle))),
(y, distance * math.sin(math.radians(angle))),
)
)

flipped = (
Expand Down

0 comments on commit ca40889

Please sign in to comment.