diff --git a/Tests/make_hash.py b/Tests/make_hash.py index c5e32d606..c52e009ec 100644 --- a/Tests/make_hash.py +++ b/Tests/make_hash.py @@ -52,10 +52,5 @@ for i0 in range(65556): print() -# print(check(min_size, min_start)) - print("#define ACCESS_TABLE_SIZE", min_size) print("#define ACCESS_TABLE_HASH", min_start) - -# for m in modes: -# print(m, "=>", hash(m, min_start) % min_size) diff --git a/Tests/test_bmp_reference.py b/Tests/test_bmp_reference.py index 8e84cc8f1..015a9ebdf 100644 --- a/Tests/test_bmp_reference.py +++ b/Tests/test_bmp_reference.py @@ -22,7 +22,6 @@ class TestBmpReference(PillowTestCase): im.load() except Exception: # as msg: pass - # print("Bad Image %s: %s" %(f,msg)) def test_questionable(self): """ These shouldn't crash/dos, but it's not well defined that these @@ -47,7 +46,6 @@ class TestBmpReference(PillowTestCase): except Exception: # as msg: if os.path.basename(f) in supported: raise - # print("Bad Image %s: %s" %(f,msg)) def test_good(self): """ These should all work. There's a set of target files in the diff --git a/Tests/test_format_hsv.py b/Tests/test_format_hsv.py index 31309da60..d7820400e 100644 --- a/Tests/test_format_hsv.py +++ b/Tests/test_format_hsv.py @@ -47,10 +47,6 @@ class TestFormatHSV(PillowTestCase): img = Image.merge('RGB', (r, g, b)) - # print(("%d, %d -> "% (int(1.75*px),int(.25*px))) + \ - # "(%s, %s, %s)"%img.getpixel((1.75*px, .25*px))) - # print(("%d, %d -> "% (int(.75*px),int(.25*px))) + \ - # "(%s, %s, %s)"%img.getpixel((.75*px, .25*px))) return img def to_xxx_colorsys(self, im, func, mode): @@ -95,15 +91,6 @@ class TestFormatHSV(PillowTestCase): im = src.convert('HSV') comparable = self.to_hsv_colorsys(src) - # print(im.getpixel((448, 64))) - # print(comparable.getpixel((448, 64))) - - # print(im.split()[0].histogram()) - # print(comparable.split()[0].histogram()) - - # im.split()[0].show() - # comparable.split()[0].show() - self.assert_image_similar(im.getchannel(0), comparable.getchannel(0), 1, "Hue conversion is wrong") self.assert_image_similar(im.getchannel(1), comparable.getchannel(1), @@ -111,16 +98,9 @@ class TestFormatHSV(PillowTestCase): self.assert_image_similar(im.getchannel(2), comparable.getchannel(2), 1, "Value conversion is wrong") - # print(im.getpixel((192, 64))) - comparable = src im = im.convert('RGB') - # im.split()[0].show() - # comparable.split()[0].show() - # print(im.getpixel((192, 64))) - # print(comparable.getpixel((192, 64))) - self.assert_image_similar(im.getchannel(0), comparable.getchannel(0), 3, "R conversion is wrong") self.assert_image_similar(im.getchannel(1), comparable.getchannel(1), @@ -132,12 +112,6 @@ class TestFormatHSV(PillowTestCase): im = hopper('RGB').convert('HSV') comparable = self.to_hsv_colorsys(hopper('RGB')) -# print([ord(x) for x in im.split()[0].tobytes()[:80]]) -# print([ord(x) for x in comparable.split()[0].tobytes()[:80]]) - -# print(im.split()[0].histogram()) -# print(comparable.split()[0].histogram()) - self.assert_image_similar(im.getchannel(0), comparable.getchannel(0), 1, "Hue conversion is wrong") self.assert_image_similar(im.getchannel(1), comparable.getchannel(1), @@ -150,12 +124,6 @@ class TestFormatHSV(PillowTestCase): converted = comparable.convert('RGB') comparable = self.to_rgb_colorsys(comparable) - # print(converted.split()[1].histogram()) - # print(target.split()[1].histogram()) - - # print([ord(x) for x in target.split()[1].tobytes()[:80]]) - # print([ord(x) for x in converted.split()[1].tobytes()[:80]]) - self.assert_image_similar(converted.getchannel(0), comparable.getchannel(0), 3, "R conversion is wrong") diff --git a/Tests/test_image_resample.py b/Tests/test_image_resample.py index 3687a1a2c..1b7081d55 100644 --- a/Tests/test_image_resample.py +++ b/Tests/test_image_resample.py @@ -352,10 +352,8 @@ class CoreResamplePassesTest(PillowTestCase): class CoreResampleCoefficientsTest(PillowTestCase): def test_reduce(self): test_color = 254 - # print() for size in range(400000, 400010, 2): - # print(size) i = Image.new('L', (size, 1), 0) draw = ImageDraw.Draw(i) draw.rectangle((0, 0, i.size[0] // 2 - 1, 0), test_color) @@ -363,7 +361,6 @@ class CoreResampleCoefficientsTest(PillowTestCase): px = i.resize((5, i.size[1]), Image.BICUBIC).load() if px[2, 0] != test_color // 2: self.assertEqual(test_color // 2, px[2, 0]) - # print('>', size, test_color // 2, px[2, 0]) def test_nonzero_coefficients(self): # regression test for the wrong coefficients calculation diff --git a/Tests/test_imagewin_pointers.py b/Tests/test_imagewin_pointers.py index 7178d8cb8..dc78b655c 100644 --- a/Tests/test_imagewin_pointers.py +++ b/Tests/test_imagewin_pointers.py @@ -96,7 +96,6 @@ if sys.platform.startswith('win32'): hdr.biClrImportant = 0 hdc = CreateCompatibleDC(None) - # print('hdc:',hex(hdc)) pixels = ctypes.c_void_p() dib = CreateDIBSection(hdc, ctypes.byref(hdr), DIB_RGB_COLORS, ctypes.byref(pixels), None, 0) diff --git a/Tests/test_numpy.py b/Tests/test_numpy.py index 4efcd2c51..03643ac1e 100644 --- a/Tests/test_numpy.py +++ b/Tests/test_numpy.py @@ -34,7 +34,6 @@ class TestNumpy(PillowTestCase): i = Image.fromarray(a) if list(i.getchannel(0).getdata()) != list(range(100)): print("data mismatch for", dtype) - # print(dtype, list(i.getdata())) return i # Check supported 1-bit integer formats diff --git a/src/PIL/BdfFontFile.py b/src/PIL/BdfFontFile.py index c8bc60461..eac19bde1 100644 --- a/src/PIL/BdfFontFile.py +++ b/src/PIL/BdfFontFile.py @@ -110,20 +110,6 @@ class BdfFontFile(FontFile.FontFile): if s.find(b"LogicalFontDescription") < 0: comments.append(s[i+1:-1].decode('ascii')) - # font = props["FONT"].split("-") - - # font[4] = bdf_slant[font[4].upper()] - # font[11] = bdf_spacing[font[11].upper()] - - # ascent = int(props["FONT_ASCENT"]) - # descent = int(props["FONT_DESCENT"]) - - # fontname = ";".join(font[1:]) - - # print("#", fontname) - # for i in comments: - # print("#", i) - while True: c = bdf_char(fp) if not c: diff --git a/src/PIL/CurImagePlugin.py b/src/PIL/CurImagePlugin.py index e4257cd5a..db9ea9874 100644 --- a/src/PIL/CurImagePlugin.py +++ b/src/PIL/CurImagePlugin.py @@ -56,14 +56,6 @@ class CurImageFile(BmpImagePlugin.BmpImageFile): m = s elif i8(s[0]) > i8(m[0]) and i8(s[1]) > i8(m[1]): m = s - # print("width", i8(s[0])) - # print("height", i8(s[1])) - # print("colors", i8(s[2])) - # print("reserved", i8(s[3])) - # print("hotspot x", i16(s[4:])) - # print("hotspot y", i16(s[6:])) - # print("bytes", i32(s[8:])) - # print("offset", i32(s[12:])) if not m: raise TypeError("No cursors were found") diff --git a/src/PIL/EpsImagePlugin.py b/src/PIL/EpsImagePlugin.py index cb2c00d20..0c50afe13 100644 --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -82,7 +82,6 @@ def Ghostscript(tile, size, fp, scale=1): # resolution is dependent on bbox and size res = (float((72.0 * size[0]) / (bbox[2]-bbox[0])), float((72.0 * size[1]) / (bbox[3]-bbox[1]))) - # print("Ghostscript", scale, size, orig_size, bbox, orig_bbox, res) import subprocess import tempfile diff --git a/src/PIL/FontFile.py b/src/PIL/FontFile.py index 46e49bc4e..305e8afa2 100644 --- a/src/PIL/FontFile.py +++ b/src/PIL/FontFile.py @@ -90,7 +90,6 @@ class FontFile(object): x = xx s = src[0] + x0, src[1] + y0, src[2] + x0, src[3] + y0 self.bitmap.paste(im.crop(src), s) - # print(chr(i), dst, s) self.metrics[i] = d, dst, s def save(self, filename): diff --git a/src/PIL/FpxImagePlugin.py b/src/PIL/FpxImagePlugin.py index d7bba42eb..509fd7d91 100644 --- a/src/PIL/FpxImagePlugin.py +++ b/src/PIL/FpxImagePlugin.py @@ -114,8 +114,6 @@ class FpxImageFile(ImageFile.ImageFile): if id in prop: self.jpeg[i] = prop[id] - # print(len(self.jpeg), "tables loaded") - self._open_subimage(1, self.maxid) def _open_subimage(self, index=1, subimage=0): @@ -143,8 +141,6 @@ class FpxImageFile(ImageFile.ImageFile): offset = i32(s, 28) length = i32(s, 32) - # print(size, self.mode, self.rawmode) - if size != self.size: raise IOError("subimage mismatch") diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 1ceabab45..64bb39b34 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -443,7 +443,6 @@ def _getdecoder(mode, decoder_name, args, extra=()): try: # get decoder decoder = getattr(core, decoder_name + "_decoder") - # print(decoder, mode, args + extra) return decoder(mode, *args + extra) except AttributeError: raise IOError("decoder %s not available" % decoder_name) @@ -465,7 +464,6 @@ def _getencoder(mode, encoder_name, args, extra=()): try: # get encoder encoder = getattr(core, encoder_name + "_encoder") - # print(encoder, mode, args + extra) return encoder(mode, *args + extra) except AttributeError: raise IOError("encoder %s not available" % encoder_name) @@ -2470,7 +2468,6 @@ def fromarray(obj, mode=None): typekey = (1, 1) + shape[2:], arr['typestr'] mode, rawmode = _fromarray_typemap[typekey] except KeyError: - # print(typekey) raise TypeError("Cannot handle this data type") else: rawmode = mode diff --git a/src/PIL/ImageMorph.py b/src/PIL/ImageMorph.py index 579ee4e1a..54ceb7905 100644 --- a/src/PIL/ImageMorph.py +++ b/src/PIL/ImageMorph.py @@ -151,11 +151,6 @@ class LutBuilder(object): patterns += self._pattern_permute(pattern, options, result) -# # Debugging -# for p, r in patterns: -# print(p, r) -# print('--') - # compile the patterns into regular expressions for speed for i, pattern in enumerate(patterns): p = pattern[0].replace('.', 'X').replace('X', '[01]') diff --git a/src/PIL/IptcImagePlugin.py b/src/PIL/IptcImagePlugin.py index f5a8de17e..83885e284 100644 --- a/src/PIL/IptcImagePlugin.py +++ b/src/PIL/IptcImagePlugin.py @@ -103,8 +103,6 @@ class IptcImageFile(ImageFile.ImageFile): else: self.info[tag] = tagdata - # print(tag, self.info[tag]) - # mode layers = i8(self.info[(3, 60)][0]) component = i8(self.info[(3, 60)][1]) diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py index a75e3d428..e38306041 100644 --- a/src/PIL/JpegImagePlugin.py +++ b/src/PIL/JpegImagePlugin.py @@ -334,7 +334,6 @@ class JpegImageFile(ImageFile.ImageFile): if i in MARKER: name, description, handler = MARKER[i] - # print(hex(i), name, description) if handler is not None: handler(self, i) if i == 0xFFDA: # start of scan diff --git a/src/PIL/SpiderImagePlugin.py b/src/PIL/SpiderImagePlugin.py index d502779e2..a0d5f17a4 100644 --- a/src/PIL/SpiderImagePlugin.py +++ b/src/PIL/SpiderImagePlugin.py @@ -74,7 +74,6 @@ def isSpiderHeader(t): labrec = int(h[13]) # no. records in file header labbyt = int(h[22]) # total no. of bytes in header lenbyt = int(h[23]) # record length in bytes - # print("labrec = %d, labbyt = %d, lenbyt = %d" % (labrec,labbyt,lenbyt)) if labbyt != (labrec * lenbyt): return 0 # looks like a valid header diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 413dc3943..ecfe8d890 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -1265,9 +1265,6 @@ class TiffImageFile(ImageFile.ImageFile): h = self.tag_v2.get(ROWSPERSTRIP, ysize) w = self.size[0] if READ_LIBTIFF or self._compression != 'raw': - # if DEBUG: - # print("Activating g4 compression for whole file") - # Decoder expects entire file as one tile. # There's a buffer size limit in load (64k) # so large g4 images will fail if we use that @@ -1540,7 +1537,6 @@ def _save(im, fp, filename): rawmode = 'I;16N' a = (rawmode, compression, _fp, filename, atts) - # print(im.mode, compression, a, im.encoderconfig) e = Image._getencoder(im.mode, 'libtiff', a, im.encoderconfig) e.setimage(im.im, (0, 0)+im.size) while True: diff --git a/src/PIL/WmfImagePlugin.py b/src/PIL/WmfImagePlugin.py index aeb19374d..6811ddcec 100644 --- a/src/PIL/WmfImagePlugin.py +++ b/src/PIL/WmfImagePlugin.py @@ -109,8 +109,6 @@ class WmfStubImageFile(ImageFile.StubImageFile): self.info["dpi"] = 72 - # print(self.mode, self.size, self.info) - # sanity check (standard metafile header) if s[22:26] != b"\x01\x00\t\x00": raise SyntaxError("Unsupported WMF file format")