mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-23 23:30:34 +03:00
Return duplicate in lena()
This commit is contained in:
parent
40ada60cec
commit
e2e361141c
12
.travis.yml
12
.travis.yml
|
@ -29,14 +29,14 @@ script:
|
|||
- python setup.py build_ext --inplace
|
||||
|
||||
# Don't cover PyPy: it fails intermittently and is x5.8 slower (#640)
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then python selftest.py; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then nosetests test/; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then python Tests/run.py; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then time python selftest.py; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then time nosetests test/; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then time python Tests/run.py; fi
|
||||
|
||||
# Cover the others
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then coverage run --append --include=PIL/* selftest.py; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then coverage run --append --include=PIL/* -m nose test/; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then python Tests/run.py --coverage; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then time coverage run --append --include=PIL/* selftest.py; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then time coverage run --append --include=PIL/* -m nose test/; fi
|
||||
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then time python Tests/run.py --coverage; fi
|
||||
|
||||
|
||||
after_success:
|
||||
|
|
|
@ -169,10 +169,9 @@ def tostring(im, format, **options):
|
|||
return out.getvalue()
|
||||
|
||||
|
||||
def lena(mode="RGB"): # , cache={}):
|
||||
def lena(mode="RGB"), cache={}):
|
||||
from PIL import Image
|
||||
# im = cache.get(mode)
|
||||
im = None
|
||||
im = cache.get(mode)
|
||||
if im is None:
|
||||
if mode == "RGB":
|
||||
im = Image.open("Images/lena.ppm")
|
||||
|
@ -182,8 +181,10 @@ def lena(mode="RGB"): # , cache={}):
|
|||
im = lena("I").convert(mode)
|
||||
else:
|
||||
im = lena("RGB").convert(mode)
|
||||
# cache[mode] = im
|
||||
return im
|
||||
cache[mode] = im
|
||||
import copy
|
||||
duplicate = copy.copy(im)
|
||||
return duplicate
|
||||
|
||||
|
||||
# def assert_image_completely_equal(a, b, msg=None):
|
||||
|
|
Loading…
Reference in New Issue
Block a user