|
45 | 45 | from itertools import count
|
46 | 46 | import platform
|
47 | 47 |
|
48 |
| -import PIL.Image |
| 48 | +from PIL import Image |
49 | 49 |
|
50 | 50 | from . import _convert
|
51 | 51 |
|
@@ -199,7 +199,7 @@ def from_param(cls, obj):
|
199 | 199 | def _load_image(buf, size):
|
200 | 200 | '''buf must be a mutable buffer.'''
|
201 | 201 | _convert.argb2rgba(buf)
|
202 |
| - return PIL.Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1) |
| 202 | + return Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1) |
203 | 203 |
|
204 | 204 |
|
205 | 205 | # check for errors opening an image file and wrap the resulting handle
|
@@ -318,8 +318,8 @@ def read_region(slide, x, y, level, w, h):
|
318 | 318 | "negative width (%d) or negative height (%d) not allowed" % (w, h)
|
319 | 319 | )
|
320 | 320 | if w == 0 or h == 0:
|
321 |
| - # PIL.Image.frombuffer() would raise an exception |
322 |
| - return PIL.Image.new('RGBA', (w, h)) |
| 321 | + # Image.frombuffer() would raise an exception |
| 322 | + return Image.new('RGBA', (w, h)) |
323 | 323 | buf = (w * h * c_uint32)()
|
324 | 324 | _read_region(slide, buf, x, y, level, w, h)
|
325 | 325 | return _load_image(buf, (w, h))
|
|
0 commit comments