Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old commented-out code #7527

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/PIL/EpsImagePlugin.py
Expand Up @@ -77,8 +77,6 @@ def Ghostscript(tile, size, fp, scale=1, transparency=False):

# Hack to support hi-res rendering
scale = int(scale) or 1
# orig_size = size
# orig_bbox = bbox
size = (size[0] * scale, size[1] * scale)
# resolution is dependent on bbox and size
res = (
Expand Down
2 changes: 0 additions & 2 deletions src/PIL/FitsImagePlugin.py
Expand Up @@ -54,12 +54,10 @@ def _open(self):
self._mode = "L"
elif number_of_bits == 16:
self._mode = "I"
# rawmode = "I;16S"
elif number_of_bits == 32:
self._mode = "I"
elif number_of_bits in (-32, -64):
self._mode = "F"
# rawmode = "F" if number_of_bits == -32 else "F;64F"

offset = math.ceil(self.fp.tell() / 2880) * 2880
self.tile = [("raw", (0, 0) + self.size, offset, (self.mode, 0, -1))]
Expand Down
1 change: 0 additions & 1 deletion src/PIL/FontFile.py
Expand Up @@ -78,7 +78,6 @@ def compile(self):
if glyph:
d, dst, src, im = glyph
xx = src[2] - src[0]
# yy = src[3] - src[1]
x0, y0 = x, y
x = x + xx
if x > WIDTH:
Expand Down
5 changes: 0 additions & 5 deletions src/PIL/GifImagePlugin.py
Expand Up @@ -281,14 +281,9 @@ def _seek(self, frame, update_image=True):
bits = self.fp.read(1)[0]
self.__offset = self.fp.tell()
break

else:
pass
# raise OSError, "illegal GIF tag `%x`" % s[0]
s = None

if interlace is None:
# self._fp = None
msg = "image not found in GIF frame"
raise EOFError(msg)

Expand Down
4 changes: 1 addition & 3 deletions src/PIL/IcoImagePlugin.py
Expand Up @@ -174,9 +174,7 @@ def __init__(self, buf):

self.entry = sorted(self.entry, key=lambda x: x["color_depth"])
# ICO images are usually squares
# self.entry = sorted(self.entry, key=lambda x: x['width'])
self.entry = sorted(self.entry, key=lambda x: x["square"])
self.entry.reverse()
self.entry = sorted(self.entry, key=lambda x: x["square"], reverse=True)

def sizes(self):
"""
Expand Down
1 change: 0 additions & 1 deletion src/PIL/ImageFile.py
Expand Up @@ -430,7 +430,6 @@ def feed(self, data):
with io.BytesIO(self.data) as fp:
im = Image.open(fp)
except OSError:
# traceback.print_exc()
pass # not enough data
else:
flag = hasattr(im, "load_seek") or hasattr(im, "load_read")
Expand Down
2 changes: 0 additions & 2 deletions src/PIL/ImagePalette.py
Expand Up @@ -257,8 +257,6 @@ def load(filename):
if lut:
break
except (SyntaxError, ValueError):
# import traceback
# traceback.print_exc()
pass
else:
msg = "cannot load palette"
Expand Down
14 changes: 0 additions & 14 deletions src/PIL/ImageQt.py
Expand Up @@ -83,16 +83,6 @@ def fromqimage(im):

def fromqpixmap(im):
return fromqimage(im)
# buffer = QBuffer()
# buffer.open(QIODevice.ReadWrite)
# # im.save(buffer)
# # What if png doesn't support some image features like animation?
# im.save(buffer, 'ppm')
# bytes_io = BytesIO()
# bytes_io.write(buffer.data())
# buffer.close()
# bytes_io.seek(0)
# return Image.open(bytes_io)


def align8to32(bytes, width, mode):
Expand Down Expand Up @@ -208,9 +198,5 @@ def toqimage(im):


def toqpixmap(im):
# # This doesn't work. For now using a dumb approach.
# im_data = _toqclass_helper(im)
# result = QPixmap(im_data["size"][0], im_data["size"][1])
# result.loadFromData(im_data["data"])
qimage = toqimage(im)
return QPixmap.fromImage(qimage)
3 changes: 0 additions & 3 deletions src/PIL/MpoImagePlugin.py
Expand Up @@ -33,9 +33,6 @@
from ._binary import i16be as i16
from ._binary import o32le

# def _accept(prefix):
# return JpegImagePlugin._accept(prefix)


def _save(im, fp, filename):
JpegImagePlugin._save(im, fp, filename)
Expand Down
3 changes: 0 additions & 3 deletions src/PIL/PpmImagePlugin.py
Expand Up @@ -328,9 +328,6 @@ def _save(im, fp, filename):
fp.write(b"65535\n")
ImageFile._save(im, fp, [("raw", (0, 0) + im.size, 0, (rawmode, 0, 1))])

# ALTERNATIVE: save via builtin debug function
# im._dump(filename)


#
# --------------------------------------------------------------------
Expand Down
17 changes: 8 additions & 9 deletions src/PIL/TiffImagePlugin.py
Expand Up @@ -1885,13 +1885,14 @@ class AppendingTiffWriter:
8, # long8
]

# StripOffsets = 273
# FreeOffsets = 288
# TileOffsets = 324
# JPEGQTables = 519
# JPEGDCTables = 520
# JPEGACTables = 521
Tags = {273, 288, 324, 519, 520, 521}
Tags = {
273, # StripOffsets
288, # FreeOffsets
324, # TileOffsets
519, # JPEGQTables
520, # JPEGDCTables
521, # JPEGACTables
}

def __init__(self, fn, new=False):
if hasattr(fn, "read"):
Expand Down Expand Up @@ -1941,8 +1942,6 @@ def finalize(self):

iimm = self.f.read(4)
if not iimm:
# msg = "nothing written into new page"
# raise RuntimeError(msg)
# Make it easy to finish a frame without committing to a new one.
return

Expand Down
18 changes: 1 addition & 17 deletions src/PIL/TiffTags.py
Expand Up @@ -56,7 +56,7 @@ def lookup(tag, group=None):
##
# Map tag numbers to tag info.
#
# id: (Name, Type, Length, enum_values)
# id: (Name, Type, Length[, enum_values])
#
# The length here differs from the length in the tiff spec. For
# numbers, the tiff spec is for the number of fields returned. We
Expand Down Expand Up @@ -438,22 +438,6 @@ def _populate():

TYPES = {}

# was:
# TYPES = {
# 1: "byte",
# 2: "ascii",
# 3: "short",
# 4: "long",
# 5: "rational",
# 6: "signed byte",
# 7: "undefined",
# 8: "signed short",
# 9: "signed long",
# 10: "signed rational",
# 11: "float",
# 12: "double",
# }

#
# These tags are handled by default in libtiff, without
# adding to the custom dictionary. From tif_dir.c, searching for
Expand Down
2 changes: 0 additions & 2 deletions winbuild/build_prepare.py
Expand Up @@ -213,7 +213,6 @@ def cmd_msbuild(
],
"headers": [r"libtiff\tiff*.h"],
"libs": [r"libtiff\*.lib"],
# "bins": [r"libtiff\*.dll"],
},
"libpng": {
"url": SF_PROJECTS + "/libpng/files/libpng16/1.6.39/lpng1639.zip/download",
Expand Down Expand Up @@ -272,7 +271,6 @@ def cmd_msbuild(
cmd_xcopy("include", "{inc_dir}"),
],
"libs": [r"objs\{msbuild_arch}\Release Static\freetype.lib"],
# "bins": [r"objs\{msbuild_arch}\Release\freetype.dll"],
},
"lcms2": {
"url": SF_PROJECTS + "/lcms/files/lcms/2.15/lcms2-2.15.tar.gz/download",
Expand Down