mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 08:14:10 +03:00
Apply suggestions from code review
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> Co-authored-by: Alexander Karpinsky <homm86@gmail.com>
This commit is contained in:
parent
27d7bd10c8
commit
e92c07f402
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ class PcfFontFile(FontFile.FontFile):
|
|||
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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user