Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <[email protected]>
Co-authored-by: Alexander Karpinsky <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent 27d7bd1 commit e92c07f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/PIL/ImageOps.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def invert(image):
:param image: The image to invert.
:return: An image.
"""
lut = [255 - i for i in range(256)]
lut = list(range(255, -1, -1))
return image.point(lut) if image.mode == "1" else _lut(image, lut)


Expand Down
2 changes: 1 addition & 1 deletion src/PIL/PcfFontFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _load_properties(self):
nprops = i32(fp.read(4))

# read property description
p = [(i32(fp.read(4)), i8(fp.read(1)), i32(fp.read(4))) for i in range(nprops)]
p = [(i32(fp.read(4)), i8(fp.read(1)), i32(fp.read(4))) for _ in range(nprops)]

if nprops & 3:
fp.seek(4 - (nprops & 3), io.SEEK_CUR) # pad
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/SpiderImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def makeSpiderHeader(im):
if nvalues < 23:
return []

hdr = [0.0 for _ in range(nvalues)]
hdr = [0.0] * nvalues

# NB these are Fortran indices
hdr[1] = 1.0 # nslice (=1 for an image)
Expand Down

0 comments on commit e92c07f

Please sign in to comment.