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
Crash after calling arc with the width parameter #4005
Comments
Pillow 6.1.0 did include a change to this function - #3824 - so it's possible that something changed. To help with reproducibility, could you provide a self-contained example? It's conceivable that the specific values you're using for |
Sure, here is a self-contained example that crashes on my system: from PIL import Image, ImageDraw
im = Image.new('RGB', (640, 640))
draw = ImageDraw.Draw(im)
draw.arc([0+0/2, 0+0/2, 640.0, 640.0], 72.0, 128.5, fill='#1890ff', width=8)
print('Drew an arc...') I used the actual values where the bug occurs. |
This should fix the crash: diff --git a/src/libImaging/Draw.c b/src/libImaging/Draw.c
index 559be1b0..dee7c524 100644
--- a/src/libImaging/Draw.c
+++ b/src/libImaging/Draw.c
@@ -834,7 +834,7 @@ ellipse(Imaging im, int x0, int y0, int x1, int y1,
// Build edge list
// malloc check UNDONE, FLOAT?
- maxEdgeCount = end - start;
+ maxEdgeCount = ceil(end - start);
if (inner) {
maxEdgeCount *= 2;
} |
Thanks all, merged! |
Hi,
What did you do?
I get an error if I use the width argument of the
arc
function. It works fine if I leave out the argument.I call the function like this:
draw.arc([0+offset/2, 0+offset/2,i_w, i_h], a_s, a_e, fill=c, width=8)
What did you expect to happen?
This should work, since it worked on a different machine 2 months ago
What actually happened?
The script crashes without an error message. I used the python tracer module and it just stops after:
What versions of Pillow and Python are you using?
Is this a local problem or is it a problem with PIL 6.1? I remember it working when I used:
The text was updated successfully, but these errors were encountered: