Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Dec 26, 2024

Currently, the *_ALLOW_THREADS macros lead to odd indentation.

Pillow/src/_imagingcms.c

Lines 349 to 367 in 0e3f51d

Py_BEGIN_ALLOW_THREADS
// transform color channels only
for (i = 0; i < im->ysize; i++) {
cmsDoTransform(hTransform, im->image[i], imOut->image[i], im->xsize);
}
// lcms by default does nothing to the auxiliary channels leaving those
// unchanged. To do "the right thing" here, i.e. maintain identical results
// with and without inPlace, we replicate those channels to the output.
//
// As of lcms 2.8, a new cmsFLAGS_COPY_ALPHA flag is introduced which would
// do the same thing automagically. Unfortunately, lcms2.8 is not yet widely
// enough available on all platforms, so we polyfill it here for now.
pyCMScopyAux(hTransform, imOut, im);
Py_END_ALLOW_THREADS
return 0;

This PR consistently adds a semicolon after them to fix this.

@hugovk hugovk merged commit 6e66166 into python-pillow:main Dec 26, 2024
49 of 50 checks passed
@radarhere radarhere deleted the threads branch December 26, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants