Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
put_pixel
function is only currently used for LA, La and PA.Pillow/src/libImaging/Access.c
Lines 187 to 208 in b945154
Pillow/src/libImaging/Access.c
Lines 130 to 137 in b945154
Since these are not image8 modes, it would be simpler to just call
put_pixel_32
insteadPillow/src/libImaging/Access.c
Lines 172 to 175 in b945154
and remove
put_pixel
.get_pixel
is similarly only currently used for LA, La and PA.It does have unique behaviour, so we can't remove it completely.
Pillow/src/libImaging/Access.c
Lines 48 to 65 in b945154
However, this PR removes the check for image8, since it is false for these modes, and the check if this is UINT8 2 bands, since it is true for these modes, and renames the function to
get_pixel_32_2bands
to indicate that it is specific.