Merge pull request #1158 from radarhere/health

Health fixes
This commit is contained in:
Alex Clark 2015-03-31 19:57:02 -04:00
commit c1a8f29944
7 changed files with 8 additions and 13 deletions

View File

@ -20,7 +20,7 @@ __version__ = "0.1"
from PIL import Image, ImageFile 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 # we map from colour field tuples to (mode, rawmode) descriptors
@ -130,15 +130,15 @@ class FpxImageFile(ImageFile.ImageFile):
fp = self.ole.openstream(stream) fp = self.ole.openstream(stream)
# skip prefix # skip prefix
p = fp.read(28) fp.read(28)
# header stream # header stream
s = fp.read(36) s = fp.read(36)
size = i32(s, 4), i32(s, 8) size = i32(s, 4), i32(s, 8)
tilecount = i32(s, 12) #tilecount = i32(s, 12)
tilesize = i32(s, 16), i32(s, 20) tilesize = i32(s, 16), i32(s, 20)
channels = i32(s, 24) #channels = i32(s, 24)
offset = i32(s, 28) offset = i32(s, 28)
length = i32(s, 32) length = i32(s, 32)

View File

@ -54,7 +54,7 @@ class PyAccess(object):
print (vals) print (vals)
self._post_init() self._post_init()
def _post_init(): def _post_init(self):
pass pass
def __setitem__(self, xy, color): def __setitem__(self, xy, color):

View File

@ -15,7 +15,6 @@
from __future__ import print_function from __future__ import print_function
import site
import getopt, string, sys import getopt, string, sys
from PIL import Image from PIL import Image

View File

@ -11,6 +11,7 @@
# 0.3 2003-05-06 fl Fixed a typo or two. # 0.3 2003-05-06 fl Fixed a typo or two.
# #
import getopt, os, sys
from __future__ import print_function from __future__ import print_function
VERSION = "pilprint 0.3/2003-05-05" 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 ) letter = ( 1.0*72, 1.0*72, 7.5*72, 10.0*72 )
def description(file, image): def description(file, image):
import os
title = os.path.splitext(os.path.split(file)[1])[0] title = os.path.splitext(os.path.split(file)[1])[0]
format = " (%dx%d " format = " (%dx%d "
if image.format: if image.format:
format = " (" + image.format + " %dx%d " format = " (" + image.format + " %dx%d "
return title + format % image.size + image.mode + ")" return title + format % image.size + image.mode + ")"
import getopt, os, sys
if len(sys.argv) == 1: if len(sys.argv) == 1:
print("PIL Print 0.2a1/96-10-04 -- print image files") print("PIL Print 0.2a1/96-10-04 -- print image files")
print("Usage: pilprint files...") print("Usage: pilprint files...")

View File

@ -165,7 +165,6 @@ class PillowTestCase(unittest.TestCase):
# helpers # helpers
import sys
py3 = (sys.version_info >= (3, 0)) py3 = (sys.version_info >= (3, 0))

View File

@ -128,13 +128,13 @@ class TestImageTransform(PillowTestCase):
# Running by default, but I'd totally understand not doing it in # Running by default, but I'd totally understand not doing it in
# the future # the future
foo = [ pattern = [
Image.new('RGBA', (1024, 1024), (a, a, a, a)) Image.new('RGBA', (1024, 1024), (a, a, a, a))
for a in range(1, 65) for a in range(1, 65)
] ]
# Yeah. Watch some JIT optimize this out. # Yeah. Watch some JIT optimize this out.
foo = None pattern = None
self.test_mesh() self.test_mesh()

View File

@ -240,7 +240,6 @@ class TestImageCms(PillowTestCase):
self.assert_image_similar(hopper(), out, 2) self.assert_image_similar(hopper(), out, 2)
def test_profile_tobytes(self): def test_profile_tobytes(self):
from io import BytesIO
i = Image.open("Tests/images/rgb.jpg") i = Image.open("Tests/images/rgb.jpg")
p = ImageCms.getOpenProfile(BytesIO(i.info["icc_profile"])) p = ImageCms.getOpenProfile(BytesIO(i.info["icc_profile"]))