Skip to content

Commit 9e37358

Browse files
committed
lowlevel: from PIL import Image
Follow the same style used elsewhere. Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent 8e9bb0e commit 9e37358

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

openslide/lowlevel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from itertools import count
4646
import platform
4747

48-
import PIL.Image
48+
from PIL import Image
4949

5050
from . import _convert
5151

@@ -199,7 +199,7 @@ def from_param(cls, obj):
199199
def _load_image(buf, size):
200200
'''buf must be a mutable buffer.'''
201201
_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)
203203

204204

205205
# 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):
318318
"negative width (%d) or negative height (%d) not allowed" % (w, h)
319319
)
320320
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))
323323
buf = (w * h * c_uint32)()
324324
_read_region(slide, buf, x, y, level, w, h)
325325
return _load_image(buf, (w, h))

0 commit comments

Comments
 (0)