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

Round box position to integer when pasting embedded color #6517



Copy link

Resolves #6515

If align="center" is used for multiline_text,


Lines 562 to 570 in 4c59f77

elif align == "center":
left += width_difference / 2.0
elif align == "right":
left += width_difference
raise ValueError('align must be "left", "center" or "right"')
(left, top),

then coord can be a float for the embedded_color paste. But when pasting one image onto another, the co-ordinates must be integers, and so an error will be raised, as in the issue., coord + coord2, mask)

This PR rounds the co-ordinates to integers in that case.

Copy link

nulano commented Aug 24, 2022

I've created radarhere#18 with a few suggestions.

nulano approved these changes Aug 25, 2022
Copy link

@nulano nulano left a comment

Choose a reason for hiding this comment

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

The alternative image is for Centos 7, for some reason the Codecov processing failed for that one coverage report:

@hugovk hugovk merged commit eb59cb6 into python-pillow:main Oct 11, 2022
58 of 60 checks passed
@radarhere radarhere deleted the multiline_centered_embedded_color branch October 11, 2022 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

Can't use "align=center" together with "embedded_color=True"
3 participants