diff --git a/PIL/IcnsImagePlugin.py b/PIL/IcnsImagePlugin.py index 883ac67dd..5f8ba063b 100644 --- a/PIL/IcnsImagePlugin.py +++ b/PIL/IcnsImagePlugin.py @@ -22,19 +22,21 @@ HEADERSIZE = 8 def nextheader(fobj): return struct.unpack('>4sI', fobj.read(HEADERSIZE)) -def read_32t(fobj, (start, length), (width, height)): +def read_32t(fobj, start_length, size): # The 128x128 icon seems to have an extra header for some reason. + (start, length) = start_length fobj.seek(start) sig = fobj.read(4) if sig != '\x00\x00\x00\x00': raise SyntaxError('Unknown signature, expecting 0x00000000') - return read_32(fobj, (start + 4, length - 4), (width, height)) + return read_32(fobj, (start + 4, length - 4), size) -def read_32(fobj, (start, length), size): +def read_32(fobj, start_length, size): """ Read a 32bit RGB icon resource. Seems to be either uncompressed or an RLE packbits-like scheme. """ + (start, length) = start_length fobj.seek(start) sizesq = size[0] * size[1] if length == sizesq * 3: @@ -73,8 +75,9 @@ def read_32(fobj, (start, length), size): im.im.putband(band.im, band_ix) return {"RGB": im} -def read_mk(fobj, (start, length), size): +def read_mk(fobj, start_length, size): # Alpha masks seem to be uncompressed + (start, length) = start_length fobj.seek(start) band = Image.frombuffer( "L", size, fobj.read(size[0]*size[1]), "raw", "L", 0, 1 diff --git a/PIL/Image.py b/PIL/Image.py index f03c8fa37..50d4e9e54 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -1332,7 +1332,8 @@ class Image: math.cos(angle), math.sin(angle), 0.0, -math.sin(angle), math.cos(angle), 0.0 ] - def transform(x, y, (a, b, c, d, e, f)=matrix): + def transform(x, y, matrix=matrix): + (a, b, c, d, e, f) = matrix return a*x + b*y + c, d*x + e*y + f # calculate output size diff --git a/PIL/ImageDraw2.py b/PIL/ImageDraw2.py index dbf1a1f88..98cf0c3eb 100644 --- a/PIL/ImageDraw2.py +++ b/PIL/ImageDraw2.py @@ -68,7 +68,8 @@ class Draw: else: getattr(self.draw, op)(xy, fill=fill, outline=outline) - def settransform(self, (xoffset, yoffset)): + def settransform(self, offset): + (xoffset, yoffset) = offset self.transform = (1, 0, xoffset, 0, 1, yoffset) def arc(self, xy, start, end, *options):