mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Removed or commented unused variables
This commit is contained in:
parent
e22e4239e5
commit
9794aafc37
|
@ -78,7 +78,8 @@ class FontFile:
|
|||
glyph = self[i]
|
||||
if glyph:
|
||||
d, dst, src, im = glyph
|
||||
xx, yy = src[2] - src[0], src[3] - src[1]
|
||||
xx = src[2] - src[0]
|
||||
# yy = src[3] - src[1]
|
||||
x0, y0 = x, y
|
||||
x = x + xx
|
||||
if x > WIDTH:
|
||||
|
|
|
@ -222,7 +222,7 @@ def getiptcinfo(im):
|
|||
offset += 2
|
||||
# resource name (usually empty)
|
||||
name_len = i8(app[offset])
|
||||
name = app[offset+1:offset+1+name_len]
|
||||
# name = app[offset+1:offset+1+name_len]
|
||||
offset = 1 + offset + name_len
|
||||
if offset & 1:
|
||||
offset += 1
|
||||
|
|
|
@ -204,7 +204,7 @@ class PcfFontFile(FontFile.FontFile):
|
|||
for i in range(4):
|
||||
bitmapSizes.append(i32(fp.read(4)))
|
||||
|
||||
byteorder = format & 4 # non-zero => MSB
|
||||
# byteorder = format & 4 # non-zero => MSB
|
||||
bitorder = format & 8 # non-zero => MSB
|
||||
padindex = format & 3
|
||||
|
||||
|
|
|
@ -731,8 +731,8 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
|
||||
# (self._compression, (extents tuple),
|
||||
# 0, (rawmode, self._compression, fp))
|
||||
ignored, extents, ignored_2, args = self.tile[0]
|
||||
args = args + (self.ifd.offset,)
|
||||
extents = self.tile[0][1]
|
||||
args = self.tile[0][3] + (self.ifd.offset,)
|
||||
decoder = Image._getdecoder(self.mode, 'libtiff', args,
|
||||
self.decoderconfig)
|
||||
try:
|
||||
|
|
|
@ -10,7 +10,7 @@ def bench(mode):
|
|||
get = im.im.getpixel
|
||||
xy = 50, 50 # position shouldn't really matter
|
||||
t0 = timeit.default_timer()
|
||||
for i in range(1000000):
|
||||
for _ in range(1000000):
|
||||
get(xy)
|
||||
print(mode, timeit.default_timer() - t0, "us")
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class TestJpegLeaks(PillowTestCase):
|
|||
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
|
||||
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
|
||||
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))
|
||||
for count in range(iterations):
|
||||
for _ in range(iterations):
|
||||
with Image.open(test_file) as im:
|
||||
im.load()
|
||||
|
||||
|
@ -29,13 +29,13 @@ class TestJpegLeaks(PillowTestCase):
|
|||
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
|
||||
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
|
||||
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))
|
||||
for count in range(iterations):
|
||||
for _ in range(iterations):
|
||||
with Image.open(test_file) as im:
|
||||
im.load()
|
||||
test_output = BytesIO()
|
||||
im.save(test_output, "JPEG2000")
|
||||
test_output.seek(0)
|
||||
output = test_output.read()
|
||||
test_output.read()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -101,7 +101,7 @@ post-patch:
|
|||
qtables = [standard_l_qtable,
|
||||
standard_chrominance_qtable]
|
||||
|
||||
for count in range(iterations):
|
||||
for _ in range(iterations):
|
||||
test_output = BytesIO()
|
||||
im.save(test_output, "JPEG", qtables=qtables)
|
||||
|
||||
|
@ -165,7 +165,7 @@ post patch:
|
|||
im = hopper('RGB')
|
||||
exif = b'12345678'*4096
|
||||
|
||||
for count in range(iterations):
|
||||
for _ in range(iterations):
|
||||
test_output = BytesIO()
|
||||
im.save(test_output, "JPEG", exif=exif)
|
||||
|
||||
|
@ -199,7 +199,7 @@ base case:
|
|||
def test_base_save(self):
|
||||
im = hopper('RGB')
|
||||
|
||||
for count in range(iterations):
|
||||
for _ in range(iterations):
|
||||
test_output = BytesIO()
|
||||
im.save(test_output, "JPEG")
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class TestWebPLeaks(PillowTestCase):
|
|||
with open(test_file, 'rb') as f:
|
||||
im_data = f.read()
|
||||
start_mem = self._get_mem_usage()
|
||||
for count in range(iterations):
|
||||
for _ in range(iterations):
|
||||
with Image.open(BytesIO(im_data)) as im:
|
||||
im.load()
|
||||
mem = (self._get_mem_usage() - start_mem)
|
||||
|
|
Loading…
Reference in New Issue
Block a user