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

If font is file-like object, do not re-read from object to get variant #6234

Merged
merged 1 commit into from May 19, 2022

Conversation

radarhere
Copy link
Member

Resolves #6209

In the issue, a user opens a font from a file-like object, and the font contents are read from that object.
Then the user tries to open a font_variant() and the font contents are read from the same object again, without seeking, which means that there is nothing left to read.

This PR changes font_variant() to just use the originally read bytes in that situation.

@hugovk hugovk merged commit fbb74a6 into python-pillow:main May 19, 2022
@radarhere radarhere deleted the font_variant branch May 19, 2022 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using font_variant on a font whose path is defined by BytesIO fails
2 participants