mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +03:00
Only import numpy when necessary
This commit is contained in:
parent
f91f93e246
commit
188d4f6b6a
|
@ -16,11 +16,6 @@
|
|||
#
|
||||
import functools
|
||||
|
||||
try:
|
||||
import numpy
|
||||
except ImportError: # pragma: no cover
|
||||
numpy = None
|
||||
|
||||
|
||||
class Filter:
|
||||
pass
|
||||
|
@ -369,6 +364,13 @@ class Color3DLUT(MultibandFilter):
|
|||
items = size[0] * size[1] * size[2]
|
||||
wrong_size = False
|
||||
|
||||
numpy = None
|
||||
if hasattr(table, "shape"):
|
||||
try:
|
||||
import numpy
|
||||
except ImportError: # pragma: no cover
|
||||
pass
|
||||
|
||||
if numpy and isinstance(table, numpy.ndarray):
|
||||
if copy_table:
|
||||
table = table.copy()
|
||||
|
|
Loading…
Reference in New Issue
Block a user