() for print, since we're using print_statement

This commit is contained in:
wiredfool 2013-03-08 21:15:22 -08:00
parent 5ba6564e26
commit 4f2a1f9715

View File

@ -536,9 +536,9 @@ class TiffImageFile(ImageFile.ImageFile):
self.__fp = self.fp self.__fp = self.fp
if Image.DEBUG: if Image.DEBUG:
print "*** TiffImageFile._open ***" print ("*** TiffImageFile._open ***")
print "- __first:", self.__first print ("- __first:", self.__first)
print "- ifh: ", ifh print ("- ifh: ", ifh)
# and load the first frame # and load the first frame
self._seek(0) self._seek(0)
@ -628,7 +628,7 @@ class TiffImageFile(ImageFile.ImageFile):
if hasattr(self.fp, "fileno"): if hasattr(self.fp, "fileno"):
# we've got a actual file on disk, pass in the fp. # we've got a actual file on disk, pass in the fp.
if Image.DEBUG: if Image.DEBUG:
print "have fileno, calling fileno version of the decoder." print ("have fileno, calling fileno version of the decoder.")
self.fp.seek(0) self.fp.seek(0)
n,e = d.decode("fpfp") # 4 bytes, otherwise the trace might error out n,e = d.decode("fpfp") # 4 bytes, otherwise the trace might error out
elif hasattr(self.fp, "getvalue"): elif hasattr(self.fp, "getvalue"):
@ -638,12 +638,12 @@ class TiffImageFile(ImageFile.ImageFile):
# unless we could do something like get the address of the underlying # unless we could do something like get the address of the underlying
# string for stringio. # string for stringio.
if Image.DEBUG: if Image.DEBUG:
print "have getvalue. just sending in a string from getvalue" print ("have getvalue. just sending in a string from getvalue")
n,e = d.decode(self.fp.getvalue()) n,e = d.decode(self.fp.getvalue())
else: else:
# we have something else. # we have something else.
if Image.DEBUG: if Image.DEBUG:
print "don't have fileno or getvalue. just reading" print ("don't have fileno or getvalue. just reading")
# UNDONE -- so much for that buffer size thing. # UNDONE -- so much for that buffer size thing.
n, e = d.decode(self.fp.read()) n, e = d.decode(self.fp.read())
@ -739,8 +739,8 @@ class TiffImageFile(ImageFile.ImageFile):
w = self.size[0] w = self.size[0]
if self._compression in ["tiff_ccitt", "group3", if self._compression in ["tiff_ccitt", "group3",
"group4", "tiff_raw_16"]: "group4", "tiff_raw_16"]:
if Image.DEBUG: ## if Image.DEBUG:
print "Activating g4 compression for whole file" ## print "Activating g4 compression for whole file"
# Decoder expects entire file as one tile. # Decoder expects entire file as one tile.
# There's a buffer size limit in load (64k) # There's a buffer size limit in load (64k)
@ -776,7 +776,8 @@ class TiffImageFile(ImageFile.ImageFile):
(self._compression, (self._compression,
(0, min(y, ysize), w, min(y+h, ysize)), (0, min(y, ysize), w, min(y+h, ysize)),
offsets[i], a)) offsets[i], a))
print "tiles: %s" % self.tile if Image.DEBUG:
print ("tiles: ", self.tile)
y = y + h y = y + h
if y >= self.size[1]: if y >= self.size[1]:
x = y = 0 x = y = 0
@ -948,8 +949,8 @@ def _save(im, fp, filename):
if libtiff: if libtiff:
if Image.DEBUG: if Image.DEBUG:
print "Saving using libtiff encoder" print ("Saving using libtiff encoder")
print ifd.items() print (ifd.items())
_fp = 0 _fp = 0
if hasattr(fp, "fileno"): if hasattr(fp, "fileno"):
fp.seek(0) fp.seek(0)
@ -984,7 +985,7 @@ def _save(im, fp, filename):
# if we don't have an ifd here, just punt. # if we don't have an ifd here, just punt.
pass pass
if Image.DEBUG: if Image.DEBUG:
print atts print (atts)
a = (rawmode, compression, _fp, filename, atts) a = (rawmode, compression, _fp, filename, atts)
e = Image._getencoder(im.mode, compression, a, im.encoderconfig) e = Image._getencoder(im.mode, compression, a, im.encoderconfig)
e.setimage(im.im, (0,0)+im.size) e.setimage(im.im, (0,0)+im.size)