Removed debugging code

This commit is contained in:
Andrew Murray 2017-11-24 21:34:58 +11:00
parent 3ea5b8c233
commit f6e4997919
5 changed files with 5 additions and 20 deletions

View File

@ -225,15 +225,12 @@ SAVE = {
}
def _save(im, fp, filename, check=0):
def _save(im, fp, filename):
try:
rawmode, bits, colors = SAVE[im.mode]
except KeyError:
raise IOError("cannot write mode %s as BMP" % im.mode)
if check:
return check
info = im.encoderinfo
dpi = info.get("dpi", (96, 96))

View File

@ -314,7 +314,7 @@ SAVE = {
}
def _save(im, fp, filename, check=0):
def _save(im, fp, filename):
try:
image_type, rawmode = SAVE[im.mode]
@ -323,9 +323,6 @@ def _save(im, fp, filename, check=0):
frames = im.encoderinfo.get("frames", 1)
if check:
return check
fp.write(("Image type: %s image\r\n" % image_type).encode('ascii'))
if filename:
fp.write(("Name: %s\r\n" % filename).encode('ascii'))

View File

@ -116,7 +116,7 @@ _COMPRESSION_TYPES = {
##
# (Internal) Image save plugin for the Palm format.
def _save(im, fp, filename, check=0):
def _save(im, fp, filename):
if im.mode == "P":
@ -165,9 +165,6 @@ def _save(im, fp, filename, check=0):
raise IOError("cannot write mode %s as Palm" % im.mode)
if check:
return check
#
# make sure image data is available
im.load()

View File

@ -119,16 +119,13 @@ SAVE = {
}
def _save(im, fp, filename, check=0):
def _save(im, fp, filename):
try:
version, bits, planes, rawmode = SAVE[im.mode]
except KeyError:
raise ValueError("Cannot save %s images as PCX" % im.mode)
if check:
return check
# bytes per plane
stride = (im.size[0] * bits + 7) // 8
# stride should be even

View File

@ -664,7 +664,7 @@ class _idat(object):
self.chunk(self.fp, b"IDAT", data)
def _save(im, fp, filename, chunk=putchunk, check=0):
def _save(im, fp, filename, chunk=putchunk):
# save an image to disk (called by the save method)
mode = im.mode
@ -706,9 +706,6 @@ def _save(im, fp, filename, chunk=putchunk, check=0):
except KeyError:
raise IOError("cannot write mode %s as PNG" % mode)
if check:
return check
#
# write minimal PNG file