Some landscape.io fixes

This commit is contained in:
hugovk 2014-11-27 21:43:45 +02:00
parent 6d1dda76bb
commit c859e3bf40
4 changed files with 15 additions and 10 deletions

View File

@ -20,7 +20,6 @@
from PIL import Image from PIL import Image
from PIL._util import isStringType from PIL._util import isStringType
import operator import operator
import math
from functools import reduce from functools import reduce

View File

@ -21,16 +21,16 @@ from PIL._util import isPath
import sys import sys
if 'PyQt4.QtGui' not in sys.modules: if 'PyQt4.QtGui' not in sys.modules:
try:
from PyQt5.QtGui import QImage, qRgba
except:
try: try:
from PyQt4.QtGui import QImage, qRgba from PyQt5.QtGui import QImage, qRgba
except: except:
from PySide.QtGui import QImage, qRgba try:
from PyQt4.QtGui import QImage, qRgba
except:
from PySide.QtGui import QImage, qRgba
else: #PyQt4 is used else: #PyQt4 is used
from PyQt4.QtGui import QImage, qRgba from PyQt4.QtGui import QImage, qRgba
## ##
# (Internal) Turns an RGB color into a Qt compatible color integer. # (Internal) Turns an RGB color into a Qt compatible color integer.

View File

@ -227,3 +227,9 @@ class TestBoxBlur(PillowTestCase):
passes=3, passes=3,
delta=1, delta=1,
) )
if __name__ == '__main__':
unittest.main()
# End of file

View File

@ -30,9 +30,9 @@ class TestFileGif(PillowTestCase):
def test_grayscale(optimize): def test_grayscale(optimize):
im = Image.new("L", (1, 1), 0) im = Image.new("L", (1, 1), 0)
file = BytesIO() filename = BytesIO()
im.save(file, "GIF", optimize=optimize) im.save(filename, "GIF", optimize=optimize)
return len(file.getvalue()) return len(filename.getvalue())
def test_bilevel(optimize): def test_bilevel(optimize):
im = Image.new("1", (1, 1), 0) im = Image.new("1", (1, 1), 0)