-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
OSError: invalid face handle #3066
Comments
What platform are you on? |
Linux, up-to-date Debian stable |
It's happening OMM, OSX 10.12.6, from binary osx wheels of 5.1.0
|
@khaledhosny any hint on where it could come from? Is there a "safer" commit/release of raqm that should be used? |
I don’t see where Raqm is involved here, |
I see... thanks for taking a look! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
did anyone find a solution, for me this error started happening as soon in installed depends/install_raqm.sh |
Also having this issue. It's also inconsistent. Sometimes my script completes with no error and sometimes throws this OSError (seemingly a random string in the array of strings I am drawing each time) then crashes. |
Just started having this issue Minimal code to reproduce: from PIL import ImageFont
font = ImageFont.truetype("arial.ttf") # using arial as example, use any font you'd like
print(font.getsize("Hello World")) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
getting error running with raqm how to resolve code: from PIL import Image, ImageDraw, ImageFont
img = Image.new('RGB', (800, 300), color = (73, 109, 137))
d = ImageDraw.Draw(img)
fnt = ImageFont.truetype('NotoSansTibetan-Regular.ttf', 24, layout_engine=ImageFont.LAYOUT_RAQM)
d.text((10, 10), "༄༅། །སྒྲུབ།", font=fnt, fill=(255, 255, 0))
img.save('result.png') error
|
Hi, I have the same issue, it seems that downloading When doing the same thing with a clean OS install, the error does not happen until I reinstall libraqm at which point I am back in a broken state. Is there a known fix for this? |
@Belval since you've been dedicated enough to try this on a clean OS, could you provide step-by-step instructions on how to replicate? |
are there people around who can't reproduce the issue? |
I can't replicate on my macOS Mojave, or on Ubuntu 18.04 on Travis CI. |
@radarhere would a Dockerfile work? I can put one together today if that helps. |
That would be great, thanks. |
Another thing is to check if the error is due to the environment language setting apt-get install -y locales
locale-gen en_US.UTF-8
export LC_ALL=en_US.UTF-8 My error goes away after I set up en_US.UTF-8. |
Reproduced on GHA: https://github.com/nulano/Pillow/actions/runs/234697378 Lines 472 to 475 in 4174d42
Edit: The logs expired, re-run with 8.0.1 added: https://github.com/nulano/Pillow/actions/runs/419599965 |
I also had this issue. Fixed by
|
Could we please have a fix for this in Pillow? As I see it, there are reported and verifiable segfaults in Pillow on a basic operation for three years, and a working fix has been suggested half a year ago. Still this has been neither fixed nor documented, and people from dozens of projects have to spend time googling the issue (see the stream of mentions above)? As I see it, simply changing the default value would work. |
@Zverik It's not a default value issue. The potential core underlying issue was identified in late November, and is a packaging/licensing issue where portions of the code will use the system Freetype library and portions using the packaged library. |
Oh, right, I see this error is also discussed in #4225 and the fix is drafted in #5062. Thanks for the tip @wiredfool, let's hope the fix works :) |
Not sure why it is producing this error, but this solution fixed it. source: python-pillow/Pillow#3066 (comment)
The proposed fix has been merged, so this should be retested when Pillow 8.2.0 is released. |
Pillow 8.2.0 has now been released. |
@radarhere Fixed the issue it seems, thanks! |
i have a problem with pillow, when i'm trying to paste image it doesn't showing in images |
Your problem doesn't seem related to this issue. If you could open a new issue with a self-contained example, so that we can run the same code that you are running, that would be helpful. |
Without the workaround, you can get a segmentation fault. See python-pillow/Pillow#3066
What did you do?
I ran the following code:
What did you expect to happen?
No segfault
What actually happened?
Here's the console output:
What versions of Pillow and Python are you using?
master
, commitcf6ec2c4a31785c1092e38569225d1d6a294111b
The text was updated successfully, but these errors were encountered: