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

changed .getsize to .getlength for compatibility with Pillow 10 #78

Conversation

ndousis
Copy link
Contributor

@ndousis ndousis commented Oct 31, 2023

Fix for #77 by changing font.getize to font.getlength in the draw_alignment method.

All tests pass.

@ndousis ndousis requested a review from ericmjl October 31, 2023 21:01
@ndousis ndousis self-assigned this Oct 31, 2023
@ndousis ndousis added the bug Something isn't working label Oct 31, 2023
Copy link
Contributor

@ericmjl ericmjl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ericmjl ericmjl merged commit cc5b445 into main Nov 1, 2023
1 check passed
@ericmjl ericmjl deleted the 77-attributeerror-freetypefont-object-has-no-attribute-getsize-pillow-10 branch November 1, 2023 01:11
@ericmjl
Copy link
Contributor

ericmjl commented Nov 1, 2023

GitBot Summary of Changes

The pull request includes changes in the draw_alignment function in the seqlike/draw_utils.py file. The changes involve replacing the 'getsize' method with 'getlength' for calculating the length of the maximum string in the 'name', 'id', and 'description' fields of the 'aligned' object. The result is then converted to an integer before being added to the 'offset'. This change has been made for the conditions when 'show_names', 'show_ids', and 'show_descriptions' are true.

cc: @ndousis, please check for correctness!

@ericmjl
Copy link
Contributor

ericmjl commented Nov 1, 2023

@ndousis I'm going to cut a new release now. This should be a patch release IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'FreeTypeFont' object has no attribute 'getsize' (Pillow 10)
2 participants