mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-06 05:05:48 +03:00
Removed duplicate imports
This commit is contained in:
parent
24eb48e9e0
commit
0b93853fd8
|
@ -84,7 +84,6 @@ def Ghostscript(tile, size, fp, scale=1):
|
|||
float((72.0 * size[1]) / (bbox[3]-bbox[1])))
|
||||
# print("Ghostscript", scale, size, orig_size, bbox, orig_bbox, res)
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
|
|
|
@ -167,7 +167,6 @@ class PillowTestCase(unittest.TestCase):
|
|||
|
||||
outfile = self.tempfile("temp.png")
|
||||
if command_succeeds([IMCONVERT, f, outfile]):
|
||||
from PIL import Image
|
||||
return Image.open(outfile)
|
||||
raise IOError()
|
||||
|
||||
|
@ -179,7 +178,6 @@ py3 = (sys.version_info >= (3, 0))
|
|||
|
||||
def fromstring(data):
|
||||
from io import BytesIO
|
||||
from PIL import Image
|
||||
return Image.open(BytesIO(data))
|
||||
|
||||
|
||||
|
@ -191,7 +189,6 @@ def tostring(im, string_format, **options):
|
|||
|
||||
|
||||
def hopper(mode=None, cache={}):
|
||||
from PIL import Image
|
||||
if mode is None:
|
||||
# Always return fresh not-yet-loaded version of image.
|
||||
# Operations on not-yet-loaded images is separate class of errors
|
||||
|
|
|
@ -90,8 +90,6 @@ class TestFileGif(PillowTestCase):
|
|||
check(256, 511, 256)
|
||||
|
||||
def test_optimize_full_l(self):
|
||||
from io import BytesIO
|
||||
|
||||
im = Image.frombytes("L", (16, 16), bytes(bytearray(range(256))))
|
||||
test_file = BytesIO()
|
||||
im.save(test_file, "GIF", optimize=True)
|
||||
|
@ -425,7 +423,7 @@ class TestFileGif(PillowTestCase):
|
|||
reloaded = Image.open(out)
|
||||
|
||||
self.assertEqual(reloaded.info['transparency'], 253)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user