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