mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Introduce isort to automate import ordering and formatting (#3954)
Introduce isort to automate import ordering and formatting
This commit is contained in:
commit
1ab5670eb1
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from PIL import Image
|
||||
import sys
|
||||
|
||||
from PIL import Image
|
||||
|
||||
if sys.maxsize < 2 ** 32:
|
||||
im = Image.new("L", (999999, 999999), 0)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
|
||||
# Not running this test by default. No DOS against Travis CI.
|
||||
import time
|
||||
|
||||
from PIL import PyAccess
|
||||
|
||||
import time
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
# Not running this test by default. No DOS against Travis CI.
|
||||
|
||||
|
||||
def iterate_get(size, access):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from . import helper
|
||||
import sys
|
||||
import timeit
|
||||
|
||||
import sys
|
||||
from . import helper
|
||||
|
||||
sys.path.insert(0, ".")
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from .helper import unittest, PillowTestCase
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
TEST_FILE = "Tests/images/fli_overflow.fli"
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
# Tests potential DOS of IcnsImagePlugin with 0 length block.
|
||||
# Run from anywhere that PIL is importable.
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image
|
||||
from PIL._util import py3
|
||||
from io import BytesIO
|
||||
|
||||
if py3:
|
||||
Image.open(BytesIO(bytes("icns\x00\x00\x00\x10hang\x00\x00\x00\x00", "latin-1")))
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import division
|
||||
from .helper import unittest, PillowTestCase
|
||||
|
||||
import sys
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
min_iterations = 100
|
||||
max_iterations = 10000
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
# Tests potential DOS of Jpeg2kImagePlugin with 0 length block.
|
||||
# Run from anywhere that PIL is importable.
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image
|
||||
from PIL._util import py3
|
||||
from io import BytesIO
|
||||
|
||||
if py3:
|
||||
Image.open(
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
from .helper import unittest, PillowTestCase
|
||||
import sys
|
||||
from PIL import Image
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
# Limits for testing the leak
|
||||
mem_limit = 1024 * 1048576
|
||||
stack_size = 8 * 1048576
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from PIL import Image
|
||||
from .helper import unittest, PillowTestCase
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
|
||||
class TestJ2kEncodeOverflow(PillowTestCase):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
from io import BytesIO
|
||||
import sys
|
||||
from io import BytesIO
|
||||
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
iterations = 5000
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import sys
|
||||
|
||||
from .helper import unittest, PillowTestCase
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
# This test is not run automatically.
|
||||
#
|
||||
|
@ -11,7 +13,6 @@ from .helper import unittest, PillowTestCase
|
|||
# Raspberry Pis). It does succeed on a 3gb Ubuntu 12.04x64 VM on Python
|
||||
# 2.7 and 3.2.
|
||||
|
||||
from PIL import Image
|
||||
|
||||
try:
|
||||
import numpy
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import sys
|
||||
|
||||
from .helper import unittest, PillowTestCase
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
# This test is not run automatically.
|
||||
#
|
||||
|
@ -10,7 +12,6 @@ from .helper import unittest, PillowTestCase
|
|||
# on any 32-bit machine, as well as any smallish things (like
|
||||
# Raspberry Pis).
|
||||
|
||||
from PIL import Image
|
||||
|
||||
try:
|
||||
import numpy as np
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from .helper import unittest, PillowTestCase
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
TEST_FILE = "Tests/images/libtiff_segfault.tif"
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
from .helper import unittest, PillowTestCase
|
||||
from PIL import Image, PngImagePlugin, ImageFile
|
||||
from io import BytesIO
|
||||
import zlib
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image, ImageFile, PngImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
TEST_FILE = "Tests/images/png_decompression_dos.png"
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import base64
|
||||
import os
|
||||
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
Helper functions.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from PIL import Image, ImageMath
|
||||
from PIL._util import py3
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,8 @@ from __future__ import print_function
|
|||
|
||||
import glob
|
||||
import os
|
||||
import traceback
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
sys.path.insert(0, ".")
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
import PIL
|
||||
import PIL.Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestSanity(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import _binary
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestBinary(PillowTestCase):
|
||||
def test_standard(self):
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
from __future__ import print_function
|
||||
from .helper import PillowTestCase
|
||||
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
import os
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
base = os.path.join("Tests", "images", "bmp")
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image, ImageFilter
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
sample = Image.new("L", (7, 5))
|
||||
# fmt: off
|
||||
|
|
|
@ -3,7 +3,8 @@ from __future__ import division
|
|||
from array import array
|
||||
|
||||
from PIL import Image, ImageFilter
|
||||
from .helper import unittest, PillowTestCase
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
try:
|
||||
import numpy
|
||||
|
|
|
@ -2,9 +2,9 @@ from __future__ import division, print_function
|
|||
|
||||
import sys
|
||||
|
||||
from .helper import unittest, PillowTestCase
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
is_pypy = hasattr(sys, "pypy_version_info")
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/hopper.ppm"
|
||||
|
||||
ORIGINAL_LIMIT = Image.MAX_IMAGE_PIXELS
|
||||
|
|
|
@ -2,10 +2,10 @@ from __future__ import unicode_literals
|
|||
|
||||
import io
|
||||
|
||||
from .helper import unittest, PillowTestCase
|
||||
|
||||
from PIL import features
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, BmpImagePlugin
|
||||
import io
|
||||
|
||||
from PIL import BmpImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestFileBmp(PillowTestCase):
|
||||
def roundtrip(self, im):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import BufrStubImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/gfs.t06z.rassda.tm00.bufr_d"
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
from PIL import ContainerIO, Image
|
||||
|
||||
from PIL import Image
|
||||
from PIL import ContainerIO
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/dummy.container"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from .helper import PillowTestCase
|
||||
from PIL import CurImagePlugin, Image
|
||||
|
||||
from PIL import Image, CurImagePlugin
|
||||
from .helper import PillowTestCase
|
||||
|
||||
TEST_FILE = "Tests/images/deerstalker.cur"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
from PIL import DcxImagePlugin, Image
|
||||
|
||||
from PIL import Image, DcxImagePlugin
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
# Created with ImageMagick: convert hopper.ppm hopper.dcx
|
||||
TEST_FILE = "Tests/images/hopper.dcx"
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from io import BytesIO
|
||||
|
||||
from PIL import DdsImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
from PIL import Image, DdsImagePlugin
|
||||
|
||||
TEST_FILE_DXT1 = "Tests/images/dxt1-rgb-4bbp-noalpha_MipMaps-1.dds"
|
||||
TEST_FILE_DXT3 = "Tests/images/dxt3-argb-8bbp-explicitalpha_MipMaps-1.dds"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, EpsImagePlugin
|
||||
import io
|
||||
|
||||
from PIL import EpsImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
HAS_GHOSTSCRIPT = EpsImagePlugin.has_ghostscript()
|
||||
|
||||
# Our two EPS test files (they are identical except for their bounding boxes)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import FitsStubImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
TEST_FILE = "Tests/images/hopper.fits"
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from .helper import PillowTestCase
|
||||
from PIL import FliImagePlugin, Image
|
||||
|
||||
from PIL import Image, FliImagePlugin
|
||||
from .helper import PillowTestCase
|
||||
|
||||
# created as an export of a palette image from Gimp2.6
|
||||
# save as...-> hopper.fli, default options.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .helper import unittest, PillowTestCase
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
try:
|
||||
from PIL import FpxImagePlugin
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestFileFtex(PillowTestCase):
|
||||
def test_load_raw(self):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from .helper import PillowTestCase
|
||||
from PIL import GbrImagePlugin, Image
|
||||
|
||||
from PIL import Image, GbrImagePlugin
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestFileGbr(PillowTestCase):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import GdImageFile
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
TEST_GD_FILE = "Tests/images/hopper.gd"
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from .helper import unittest, PillowTestCase, hopper, netpbm_available
|
||||
|
||||
from PIL import Image, ImagePalette, GifImagePlugin, ImageDraw
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import GifImagePlugin, Image, ImageDraw, ImagePalette
|
||||
|
||||
from .helper import PillowTestCase, hopper, netpbm_available, unittest
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import GimpGradientFile
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestImage(PillowTestCase):
|
||||
def test_linear_pos_le_middle(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL.GimpPaletteFile import GimpPaletteFile
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestImage(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import GribStubImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/WAlaska.wind.7days.grb"
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Hdf5StubImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
TEST_FILE = "Tests/images/hdf5.h5"
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from .helper import unittest, PillowTestCase
|
||||
|
||||
from PIL import Image, IcnsImagePlugin
|
||||
|
||||
import io
|
||||
import sys
|
||||
|
||||
from PIL import IcnsImagePlugin, Image
|
||||
|
||||
from .helper import PillowTestCase, unittest
|
||||
|
||||
# sample icon file
|
||||
TEST_FILE = "Tests/images/pillow.icns"
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
import io
|
||||
from PIL import Image, ImageDraw, IcoImagePlugin
|
||||
|
||||
from PIL import IcoImagePlugin, Image, ImageDraw
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_ICO_FILE = "Tests/images/hopper.ico"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, ImImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
# sample im
|
||||
TEST_IM = "Tests/images/hopper.im"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, IptcImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/iptc.jpg"
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
from .helper import djpeg_available, cjpeg_available
|
||||
|
||||
from io import BytesIO
|
||||
import os
|
||||
import sys
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image
|
||||
from PIL import ImageFile
|
||||
from PIL import JpegImagePlugin
|
||||
from PIL import Image, ImageFile, JpegImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, cjpeg_available, djpeg_available, hopper, unittest
|
||||
|
||||
codecs = dir(Image.core)
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from .helper import PillowTestCase
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image, Jpeg2KImagePlugin
|
||||
from io import BytesIO
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
codecs = dir(Image.core)
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
from __future__ import print_function
|
||||
from .helper import PillowTestCase, hopper
|
||||
from PIL import features
|
||||
from PIL._util import py3
|
||||
|
||||
import distutils.version
|
||||
import io
|
||||
import itertools
|
||||
import logging
|
||||
import os
|
||||
from collections import namedtuple
|
||||
from ctypes import c_float
|
||||
import io
|
||||
import logging
|
||||
import itertools
|
||||
import os
|
||||
import distutils.version
|
||||
|
||||
from PIL import Image, TiffImagePlugin, TiffTags
|
||||
from PIL import Image, TiffImagePlugin, TiffTags, features
|
||||
from PIL._util import py3
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image, McIdasImagePlugin
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestFileMcIdas(PillowTestCase):
|
||||
def test_invalid_file(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, ImagePalette, features
|
||||
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
try:
|
||||
from PIL import MicImagePlugin
|
||||
except ImportError:
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from .helper import PillowTestCase
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
test_files = ["Tests/images/sugarshack.mpo", "Tests/images/frozenpond.mpo"]
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
import os
|
||||
|
||||
from PIL import Image, MspImagePlugin
|
||||
|
||||
import os
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
TEST_FILE = "Tests/images/hopper.msp"
|
||||
EXTRA_DIR = "Tests/images/picins"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper, imagemagick_available
|
||||
|
||||
import os.path
|
||||
|
||||
from .helper import PillowTestCase, hopper, imagemagick_available
|
||||
|
||||
|
||||
class TestFilePalm(PillowTestCase):
|
||||
_roundtrip = imagemagick_available()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestFilePcd(PillowTestCase):
|
||||
def test_load_raw(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, ImageFile, PcxImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestFilePcx(PillowTestCase):
|
||||
def _roundtrip(self, im):
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
from PIL import Image, PdfParser
|
||||
import io
|
||||
import os
|
||||
import os.path
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
from PIL import Image, PdfParser
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestFilePdf(PillowTestCase):
|
||||
def helper_save_as_pdf(self, mode, **kwargs):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import hopper, PillowTestCase
|
||||
|
||||
from PIL import Image, PixarImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/hopper.pxr"
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from .helper import unittest, PillowTestCase, PillowLeakTestCase, hopper
|
||||
import sys
|
||||
import zlib
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image, ImageFile, PngImagePlugin
|
||||
from PIL._util import py3
|
||||
|
||||
from io import BytesIO
|
||||
import zlib
|
||||
import sys
|
||||
from .helper import PillowLeakTestCase, PillowTestCase, hopper, unittest
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
# sample ppm stream
|
||||
test_file = "Tests/images/hopper.ppm"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import hopper, PillowTestCase
|
||||
|
||||
from PIL import Image, PsdImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
test_file = "Tests/images/hopper.psd"
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, SgiImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestFileSgi(PillowTestCase):
|
||||
def test_rgb(self):
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
from PIL import ImageSequence
|
||||
from PIL import SpiderImagePlugin
|
||||
|
||||
import tempfile
|
||||
|
||||
from PIL import Image, ImageSequence, SpiderImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/hopper.spider"
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
import os
|
||||
|
||||
from PIL import Image, SunImagePlugin
|
||||
|
||||
import os
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
EXTRA_DIR = "Tests/images/sunraster"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image, TarIO
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
codecs = dir(Image.core)
|
||||
|
||||
# Sample tar archive
|
||||
|
|
|
@ -2,10 +2,9 @@ import os
|
|||
from glob import glob
|
||||
from itertools import product
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
_TGA_DIR = os.path.join("Tests", "images", "tga")
|
||||
_TGA_DIR_COMMON = os.path.join(_TGA_DIR, "common")
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import logging
|
||||
from io import BytesIO
|
||||
import sys
|
||||
|
||||
from .helper import unittest, PillowTestCase, hopper
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image, TiffImagePlugin, features
|
||||
from PIL._util import py3
|
||||
from PIL.TiffImagePlugin import X_RESOLUTION, Y_RESOLUTION, RESOLUTION_UNIT
|
||||
from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION
|
||||
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import io
|
||||
import struct
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, TiffImagePlugin, TiffTags
|
||||
from PIL.TiffImagePlugin import _limit_rational, IFDRational
|
||||
from PIL.TiffImagePlugin import IFDRational, _limit_rational
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
tag_ids = {info.name: info.value for info in TiffTags.TAGS_V2.values()}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import WalImageFile
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestFileWal(PillowTestCase):
|
||||
def test_open(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, WebPImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
except ImportError:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
try:
|
||||
from PIL import _webp
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
from PIL import Image, WmfImagePlugin
|
||||
|
||||
from PIL import Image
|
||||
from PIL import WmfImagePlugin
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestFileWmf(PillowTestCase):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
PIL151 = b"""
|
||||
#define basic_width 32
|
||||
#define basic_height 32
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, XpmImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/hopper.xpm"
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import hopper, PillowTestCase
|
||||
|
||||
from PIL import Image, XVThumbImagePlugin
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
TEST_FILE = "Tests/images/hopper.p7"
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from .helper import PillowTestCase
|
||||
from PIL import BdfFontFile, FontFile
|
||||
|
||||
from PIL import FontFile, BdfFontFile
|
||||
from .helper import PillowTestCase
|
||||
|
||||
filename = "Tests/images/courB08.bdf"
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
from __future__ import division
|
||||
from .helper import unittest, PillowLeakTestCase
|
||||
|
||||
import sys
|
||||
from PIL import Image, features, ImageDraw, ImageFont
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont, features
|
||||
|
||||
from .helper import PillowLeakTestCase, unittest
|
||||
|
||||
|
||||
@unittest.skipIf(sys.platform.startswith("win32"), "requires Unix or macOS")
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image, FontFile, PcfFontFile
|
||||
from PIL import ImageFont, ImageDraw
|
||||
from PIL import FontFile, Image, ImageDraw, ImageFont, PcfFontFile
|
||||
from PIL._util import py3
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
codecs = dir(Image.core)
|
||||
|
||||
fontname = "Tests/fonts/10x20-ISO8859-1.pcf"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
import colorsys
|
||||
import itertools
|
||||
|
||||
from PIL import Image
|
||||
from PIL._util import py3
|
||||
|
||||
import colorsys
|
||||
import itertools
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestFormatHSV(PillowTestCase):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestFormatLab(PillowTestCase):
|
||||
def test_white(self):
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from .helper import unittest, PillowTestCase, hopper
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
from PIL import Image
|
||||
from PIL._util import py3
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
from .helper import PillowTestCase, hopper, unittest
|
||||
|
||||
|
||||
class TestImage(PillowTestCase):
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from .helper import unittest, PillowTestCase, hopper, on_appveyor
|
||||
import os
|
||||
import sys
|
||||
|
||||
from PIL import Image
|
||||
import sys
|
||||
import os
|
||||
|
||||
from .helper import PillowTestCase, hopper, on_appveyor, unittest
|
||||
|
||||
# CFFI imports pycparser which doesn't support PYTHONOPTIMIZE=2
|
||||
# https://github.com/eliben/pycparser/pull/198#issuecomment-317001670
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
im = hopper().resize((128, 100))
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageConvert(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
import copy
|
||||
|
||||
from PIL import Image
|
||||
|
||||
import copy
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageCopy(PillowTestCase):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageCrop(PillowTestCase):
|
||||
def test_crop(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, fromstring, tostring
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, fromstring, tostring
|
||||
|
||||
|
||||
class TestImageDraft(PillowTestCase):
|
||||
def setUp(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image, ImageFilter
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageFilter(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageFromBytes(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from PIL import Image, ImageQt
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
from .test_imageqt import PillowQtTestCase
|
||||
|
||||
from PIL import ImageQt, Image
|
||||
|
||||
|
||||
class TestFromQImage(PillowQtTestCase, PillowTestCase):
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase
|
||||
|
||||
|
||||
class TestImageGetBands(PillowTestCase):
|
||||
def test_getbands(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageGetBbox(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
from PIL._util import py3
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageGetIm(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageGetProjection(PillowTestCase):
|
||||
def test_sanity(self):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from .helper import PillowTestCase, hopper
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
|
||||
import os
|
||||
from .helper import PillowTestCase, hopper
|
||||
|
||||
|
||||
class TestImageLoad(PillowTestCase):
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user