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

Fixed linear_gradient and radial_gradient I and F modes #5274

Merged
merged 1 commit into from Mar 28, 2021

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Feb 19, 2021

Resolves #5272

Image.linear_gradient("I"), Image.linear_gradient("F"), Image.radial_gradient("I") and Image.radial_gradient("F") all currently segfault. This fixes them.

@radarhere radarhere added the Bug label Feb 19, 2021
@radarhere radarhere changed the title Fixed linear_gradient I mode Fixed linear_gradient and radial_gradient I mode Feb 22, 2021
@radarhere radarhere changed the title Fixed linear_gradient and radial_gradient I mode Fixed linear_gradient and radial_gradient I and F modes Feb 22, 2021
int x;
for (y = 0; y < 256; y++) {
for (x = 0; x < 256; x++) {
if (im->type == IMAGING_TYPE_FLOAT32) {
Copy link
Member

@hugovk hugovk Mar 7, 2021

Does refactoring this check outside the 256 * 256 loop make any sort of performance difference?

Copy link
Member

@wiredfool wiredfool Mar 7, 2021

Branch prediction should be bang on for this one. And I'd even expect that the compiler would hoist this.

@wiredfool wiredfool merged commit 9a683db into python-pillow:master Mar 28, 2021
50 checks passed
@radarhere radarhere deleted the gradient branch Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants