mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Better import of _imagingagg and ImageDraw2
This commit is contained in:
parent
50878f5767
commit
a442d5fa06
|
@ -313,13 +313,11 @@ def getdraw(im=None, hints=None):
|
||||||
handler = None
|
handler = None
|
||||||
if not hints or "nicest" in hints:
|
if not hints or "nicest" in hints:
|
||||||
try:
|
try:
|
||||||
import _imagingagg
|
import _imagingagg as handler
|
||||||
handler = _imagingagg
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
if handler is None:
|
if handler is None:
|
||||||
from PIL import ImageDraw2
|
from PIL import ImageDraw2 as handler
|
||||||
handler = ImageDraw2
|
|
||||||
if im:
|
if im:
|
||||||
im = handler.Draw(im)
|
im = handler.Draw(im)
|
||||||
return im, handler
|
return im, handler
|
||||||
|
|
Loading…
Reference in New Issue
Block a user