Skip to content

Commit

Permalink
Merge 578096e into 17d38d0
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 19, 2016
2 parents 17d38d0 + 578096e commit c777944
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions PIL/BdfFontFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ def __init__(self, fp):

# fontname = ";".join(font[1:])

# print "#", fontname
# print("#", fontname)
# for i in comments:
# print "#", i
# print("#", i)

while True:
c = bdf_char(fp)
Expand Down
16 changes: 8 additions & 8 deletions PIL/CurImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def _open(self):
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:])
# 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")

Expand Down
2 changes: 1 addition & 1 deletion PIL/FontFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def compile(self):
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
# print(chr(i), dst, s)
self.metrics[i] = d, dst, s

def save(self, filename):
Expand Down
4 changes: 2 additions & 2 deletions PIL/FpxImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _open_index(self, index=1):
if id in prop:
self.jpeg[i] = prop[id]

# print len(self.jpeg), "tables loaded"
# print(len(self.jpeg), "tables loaded")

self._open_subimage(1, self.maxid)

Expand Down Expand Up @@ -141,7 +141,7 @@ def _open_subimage(self, index=1, subimage=0):
offset = i32(s, 28)
length = i32(s, 32)

# print size, self.mode, self.rawmode
# print(size, self.mode, self.rawmode)

if size != self.size:
raise IOError("subimage mismatch")
Expand Down
2 changes: 1 addition & 1 deletion PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ def fromarray(obj, mode=None):
typekey = (1, 1) + shape[2:], arr['typestr']
mode, rawmode = _fromarray_typemap[typekey]
except KeyError:
# print typekey
# print(typekey)
raise TypeError("Cannot handle this data type")
else:
rawmode = mode
Expand Down
4 changes: 2 additions & 2 deletions PIL/ImageMorph.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def build_lut(self):

# # Debugging
# for p,r in patterns:
# print p,r
# print '--'
# print(p,r)
# print('--')

# compile the patterns into regular expressions for speed
for i, pattern in enumerate(patterns):
Expand Down
2 changes: 1 addition & 1 deletion PIL/IptcImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _open(self):
else:
self.info[tag] = tagdata

# print tag, self.info[tag]
# print(tag, self.info[tag])

# mode
layers = i8(self.info[(3, 60)][0])
Expand Down
2 changes: 1 addition & 1 deletion PIL/JpegImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _open(self):

if i in MARKER:
name, description, handler = MARKER[i]
# print hex(i), name, description
# print(hex(i), name, description)
if handler is not None:
handler(self, i)
if i == 0xFFDA: # start of scan
Expand Down
2 changes: 1 addition & 1 deletion PIL/SpiderImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ 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)
# print("labrec = %d, labbyt = %d, lenbyt = %d" % (labrec,labbyt,lenbyt))
if labbyt != (labrec * lenbyt):
return 0
# looks like a valid header
Expand Down
6 changes: 3 additions & 3 deletions PIL/TiffImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def delegate(self, *args):
'rfloordiv','mod','rmod', 'pow','rpow', 'pos', 'neg',
'abs', 'trunc', 'lt', 'gt', 'le', 'ge', 'nonzero',
'ceil', 'floor', 'round']
print "\n".join("__%s__ = _delegate('__%s__')" % (s,s) for s in a)
print("\n".join("__%s__ = _delegate('__%s__')" % (s,s) for s in a))
"""

__add__ = _delegate('__add__')
Expand Down Expand Up @@ -804,7 +804,7 @@ class ImageFileDirectory_v1(ImageFileDirectory_v2):
ifd = ImageFileDirectory_v1()
ifd[key] = 'Some Data'
ifd.tagtype[key] = 2
print ifd[key]
print(ifd[key])
('Some Data',)
Also contains a dictionary of tag types as read from the tiff image file,
Expand Down Expand Up @@ -1201,7 +1201,7 @@ def _setup(self):
"tiff_sgilog24",
"tiff_raw_16"]:
# if DEBUG:
# print "Activating g4 compression for whole file"
# print("Activating g4 compression for whole file")

# Decoder expects entire file as one tile.
# There's a buffer size limit in load (64k)
Expand Down
2 changes: 1 addition & 1 deletion PIL/WmfImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _open(self):

self.info["dpi"] = 72

# print self.mode, self.size, self.info
# print(self.mode, self.size, self.info)

# sanity check (standard metafile header)
if s[22:26] != b"\x01\x00\t\x00":
Expand Down
4 changes: 2 additions & 2 deletions Tests/make_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def check(size, i0):

print()

# print check(min_size, min_start)
# 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
# print(m, "=>", hash(m, min_start) % min_size)
4 changes: 2 additions & 2 deletions Tests/test_bmp_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_bad(self):
im.load()
except Exception: # as msg:
pass
# print ("Bad Image %s: %s" %(f,msg))
# print("Bad Image %s: %s" %(f,msg))

def test_questionable(self):
""" These shouldn't crash/dos, but it's not well defined that these
Expand All @@ -46,7 +46,7 @@ def test_questionable(self):
except Exception: # as msg:
if os.path.basename(f) in supported:
raise
# print ("Bad Image %s: %s" %(f,msg))
# print("Bad Image %s: %s" %(f,msg))

def test_good(self):
""" These should all work. There's a set of target files in the
Expand Down
24 changes: 12 additions & 12 deletions Tests/test_format_hsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def wedge(self):

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))) + \
# 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

Expand Down Expand Up @@ -95,8 +95,8 @@ def test_wedge(self):
im = src.convert('HSV')
comparable = self.to_hsv_colorsys(src)

# print (im.getpixel((448, 64)))
# print (comparable.getpixel((448, 64)))
# print(im.getpixel((448, 64)))
# print(comparable.getpixel((448, 64)))

# print(im.split()[0].histogram())
# print(comparable.split()[0].histogram())
Expand All @@ -111,15 +111,15 @@ def test_wedge(self):
self.assert_image_similar(im.split()[2], comparable.split()[2],
1, "Value conversion is wrong")

# print (im.getpixel((192, 64)))
# 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)))
# print(im.getpixel((192, 64)))
# print(comparable.getpixel((192, 64)))

self.assert_image_similar(im.split()[0], comparable.split()[0],
3, "R conversion is wrong")
Expand All @@ -132,8 +132,8 @@ def test_convert(self):
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([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())
Expand All @@ -153,8 +153,8 @@ def test_hsv_to_rgb(self):
# 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]])
# 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.split()[0], comparable.split()[0],
3, "R conversion is wrong")
Expand Down
6 changes: 3 additions & 3 deletions Tests/test_image_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,18 @@ def test_both(self):
class CoreResampleCoefficientsTest(PillowTestCase):
def test_reduce(self):
test_color = 254
# print ''
# print()

for size in range(400000, 400010, 2):
# print '\r', size,
# 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)

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 '\r>', size, 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
Expand Down
6 changes: 3 additions & 3 deletions Tests/test_locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
# on windows, in polish locale:

# import locale
# print locale.setlocale(locale.LC_ALL, 'polish')
# print(locale.setlocale(locale.LC_ALL, 'polish'))
# import string
# print len(string.whitespace)
# print ord(string.whitespace[6])
# print(len(string.whitespace))
# print(ord(string.whitespace[6]))

# Polish_Poland.1250
# 7
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def to_image(dtype, bands=1, boolean=0):
i = Image.fromarray(a)
if list(i.split()[0].getdata()) != list(range(100)):
print("data mismatch for", dtype)
# print dtype, list(i.getdata())
# print(dtype, list(i.getdata()))
return i

# Check supported 1-bit integer formats
Expand Down

0 comments on commit c777944

Please sign in to comment.