From 75a760e5d6abe351e159fb1ce78a889d4a698d36 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2015 09:35:45 +1100 Subject: [PATCH 1/7] Fixed unused imports and removed or commented unused variables from FpximagePlugin --- PIL/FpxImagePlugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PIL/FpxImagePlugin.py b/PIL/FpxImagePlugin.py index 7e1d09dc8..e435cb447 100644 --- a/PIL/FpxImagePlugin.py +++ b/PIL/FpxImagePlugin.py @@ -20,7 +20,7 @@ __version__ = "0.1" from PIL import Image, ImageFile -from PIL.OleFileIO import * +from PIL.OleFileIO import i8, i32, MAGIC # we map from colour field tuples to (mode, rawmode) descriptors @@ -130,15 +130,15 @@ class FpxImageFile(ImageFile.ImageFile): fp = self.ole.openstream(stream) # skip prefix - p = fp.read(28) + fp.read(28) # header stream s = fp.read(36) size = i32(s, 4), i32(s, 8) - tilecount = i32(s, 12) + #tilecount = i32(s, 12) tilesize = i32(s, 16), i32(s, 20) - channels = i32(s, 24) + #channels = i32(s, 24) offset = i32(s, 28) length = i32(s, 32) From d88a7b778fcebee6afabf1d939a9fd9d48853e32 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2015 08:58:10 +1100 Subject: [PATCH 2/7] Added missing self argument in PyAccess --- PIL/PyAccess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/PyAccess.py b/PIL/PyAccess.py index 28829051d..a3f1c3909 100644 --- a/PIL/PyAccess.py +++ b/PIL/PyAccess.py @@ -54,7 +54,7 @@ class PyAccess(object): print (vals) self._post_init() - def _post_init(): + def _post_init(self): pass def __setitem__(self, xy, color): From 0ca14909eddd9d158b692015f763c95782150a36 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2015 09:04:28 +1100 Subject: [PATCH 3/7] Fixed duplicate import in pilprint --- Scripts/pilprint.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Scripts/pilprint.py b/Scripts/pilprint.py index be42e0a75..efa2b9862 100644 --- a/Scripts/pilprint.py +++ b/Scripts/pilprint.py @@ -11,6 +11,7 @@ # 0.3 2003-05-06 fl Fixed a typo or two. # +import getopt, os, sys from __future__ import print_function VERSION = "pilprint 0.3/2003-05-05" @@ -21,15 +22,12 @@ from PIL import PSDraw letter = ( 1.0*72, 1.0*72, 7.5*72, 10.0*72 ) def description(file, image): - import os title = os.path.splitext(os.path.split(file)[1])[0] format = " (%dx%d " if image.format: format = " (" + image.format + " %dx%d " return title + format % image.size + image.mode + ")" -import getopt, os, sys - if len(sys.argv) == 1: print("PIL Print 0.2a1/96-10-04 -- print image files") print("Usage: pilprint files...") From 128280e5b85147c7c64ee1225b7f4f7e64bfec8e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2015 09:08:39 +1100 Subject: [PATCH 4/7] Fixed duplicate import in Tests helper --- Tests/helper.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/helper.py b/Tests/helper.py index 563f42060..d8f88656b 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -165,7 +165,6 @@ class PillowTestCase(unittest.TestCase): # helpers -import sys py3 = (sys.version_info >= (3, 0)) From 192fa39fb72ee88ad5039f8f217b769502f0ac0d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2015 09:10:12 +1100 Subject: [PATCH 5/7] Fixed duplicate import in test_imagecms --- Tests/test_imagecms.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/test_imagecms.py b/Tests/test_imagecms.py index d669b4de5..93bdda44c 100644 --- a/Tests/test_imagecms.py +++ b/Tests/test_imagecms.py @@ -240,7 +240,6 @@ class TestImageCms(PillowTestCase): self.assert_image_similar(hopper(), out, 2) def test_profile_tobytes(self): - from io import BytesIO i = Image.open("Tests/images/rgb.jpg") p = ImageCms.getOpenProfile(BytesIO(i.info["icc_profile"])) From 444d9d5731d622019f5c1ad51a792dce976e8412 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2015 10:29:26 +1100 Subject: [PATCH 6/7] Changed variable name foo since it has been blacklisted in health --- Tests/test_image_transform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/test_image_transform.py b/Tests/test_image_transform.py index 4306e9b43..26ff8822c 100644 --- a/Tests/test_image_transform.py +++ b/Tests/test_image_transform.py @@ -128,13 +128,13 @@ class TestImageTransform(PillowTestCase): # Running by default, but I'd totally understand not doing it in # the future - foo = [ + pattern = [ Image.new('RGBA', (1024, 1024), (a, a, a, a)) for a in range(1, 65) ] # Yeah. Watch some JIT optimize this out. - foo = None + pattern = None self.test_mesh() From d3cab99d318ccc7ea4effabaf49b583b093ef843 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 1 Apr 2015 10:33:44 +1100 Subject: [PATCH 7/7] Removed unused import in pilconvert script --- Scripts/pilconvert.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/pilconvert.py b/Scripts/pilconvert.py index 934167351..0341994c9 100644 --- a/Scripts/pilconvert.py +++ b/Scripts/pilconvert.py @@ -15,7 +15,6 @@ from __future__ import print_function -import site import getopt, string, sys from PIL import Image