Skip to content

Commit 9b8c23e

Browse files
authored
Merge pull request #7527 from akx/remove-commented-out-code
2 parents 8a13bf8 + 0c70569 commit 9b8c23e

13 files changed

+10
-64
lines changed

src/PIL/EpsImagePlugin.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ def Ghostscript(tile, size, fp, scale=1, transparency=False):
7777

7878
# Hack to support hi-res rendering
7979
scale = int(scale) or 1
80-
# orig_size = size
81-
# orig_bbox = bbox
8280
size = (size[0] * scale, size[1] * scale)
8381
# resolution is dependent on bbox and size
8482
res = (

src/PIL/FitsImagePlugin.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ def _open(self):
5454
self._mode = "L"
5555
elif number_of_bits == 16:
5656
self._mode = "I"
57-
# rawmode = "I;16S"
5857
elif number_of_bits == 32:
5958
self._mode = "I"
6059
elif number_of_bits in (-32, -64):
6160
self._mode = "F"
62-
# rawmode = "F" if number_of_bits == -32 else "F;64F"
6361

6462
offset = math.ceil(self.fp.tell() / 2880) * 2880
6563
self.tile = [("raw", (0, 0) + self.size, offset, (self.mode, 0, -1))]

src/PIL/FontFile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def compile(self):
7878
if glyph:
7979
d, dst, src, im = glyph
8080
xx = src[2] - src[0]
81-
# yy = src[3] - src[1]
8281
x0, y0 = x, y
8382
x = x + xx
8483
if x > WIDTH:

src/PIL/GifImagePlugin.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,9 @@ def _seek(self, frame, update_image=True):
281281
bits = self.fp.read(1)[0]
282282
self.__offset = self.fp.tell()
283283
break
284-
285-
else:
286-
pass
287-
# raise OSError, "illegal GIF tag `%x`" % s[0]
288284
s = None
289285

290286
if interlace is None:
291-
# self._fp = None
292287
msg = "image not found in GIF frame"
293288
raise EOFError(msg)
294289

src/PIL/IcoImagePlugin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ def __init__(self, buf):
174174

175175
self.entry = sorted(self.entry, key=lambda x: x["color_depth"])
176176
# ICO images are usually squares
177-
# self.entry = sorted(self.entry, key=lambda x: x['width'])
178-
self.entry = sorted(self.entry, key=lambda x: x["square"])
179-
self.entry.reverse()
177+
self.entry = sorted(self.entry, key=lambda x: x["square"], reverse=True)
180178

181179
def sizes(self):
182180
"""

src/PIL/ImageFile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ def feed(self, data):
430430
with io.BytesIO(self.data) as fp:
431431
im = Image.open(fp)
432432
except OSError:
433-
# traceback.print_exc()
434433
pass # not enough data
435434
else:
436435
flag = hasattr(im, "load_seek") or hasattr(im, "load_read")

src/PIL/ImagePalette.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ def load(filename):
257257
if lut:
258258
break
259259
except (SyntaxError, ValueError):
260-
# import traceback
261-
# traceback.print_exc()
262260
pass
263261
else:
264262
msg = "cannot load palette"

src/PIL/ImageQt.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@ def fromqimage(im):
8383

8484
def fromqpixmap(im):
8585
return fromqimage(im)
86-
# buffer = QBuffer()
87-
# buffer.open(QIODevice.ReadWrite)
88-
# # im.save(buffer)
89-
# # What if png doesn't support some image features like animation?
90-
# im.save(buffer, 'ppm')
91-
# bytes_io = BytesIO()
92-
# bytes_io.write(buffer.data())
93-
# buffer.close()
94-
# bytes_io.seek(0)
95-
# return Image.open(bytes_io)
9686

9787

9888
def align8to32(bytes, width, mode):
@@ -208,9 +198,5 @@ def toqimage(im):
208198

209199

210200
def toqpixmap(im):
211-
# # This doesn't work. For now using a dumb approach.
212-
# im_data = _toqclass_helper(im)
213-
# result = QPixmap(im_data["size"][0], im_data["size"][1])
214-
# result.loadFromData(im_data["data"])
215201
qimage = toqimage(im)
216202
return QPixmap.fromImage(qimage)

src/PIL/MpoImagePlugin.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
from ._binary import i16be as i16
3434
from ._binary import o32le
3535

36-
# def _accept(prefix):
37-
# return JpegImagePlugin._accept(prefix)
38-
3936

4037
def _save(im, fp, filename):
4138
JpegImagePlugin._save(im, fp, filename)

src/PIL/PpmImagePlugin.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@ def _save(im, fp, filename):
328328
fp.write(b"65535\n")
329329
ImageFile._save(im, fp, [("raw", (0, 0) + im.size, 0, (rawmode, 0, 1))])
330330

331-
# ALTERNATIVE: save via builtin debug function
332-
# im._dump(filename)
333-
334331

335332
#
336333
# --------------------------------------------------------------------

0 commit comments

Comments
 (0)