Skip to content

Commit 3cec0a2

Browse files
author
Jannes Grzebien
committed
Fix PIL Image class import
1 parent d0e0b13 commit 3cec0a2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

erogaki_wrapper_shared_python/ImageProcessor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
import io
2-
import PIL
2+
from PIL import Image
33

44
class ImageProcessor:
55
@staticmethod
6-
def bytes_to_image(bytes: bytes) -> PIL.Image.Image:
6+
def bytes_to_image(bytes: bytes) -> Image.Image:
77
"""Convert encoded image file to PIL image object.
88
99
Args:
1010
bytes (bytes): Encoded image file as byte string
1111
1212
Returns:
13-
PIL.Image.Image
13+
Image.Image
1414
"""
1515
img_file = io.BytesIO(bytes)
1616
img_file.seek(0)
17-
return PIL.Image.open(img_file)
17+
return Image.open(img_file)
1818

1919
@staticmethod
20-
def image_to_bytes(image: PIL.Image.Image) -> bytes:
20+
def image_to_bytes(image: Image.Image) -> bytes:
2121
"""Convert PIL image object to PNG.
2222
2323
Args:
24-
image (PIL.Image.Image)
24+
image (Image.Image)
2525
2626
Returns:
2727
bytes: PNG file as byte string

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = erogaki-wrapper-shared-python
3-
version = 0.7
3+
version = 0.7.1
44
author = erogaki-devs (undefinedprojects, Yurifag)
55
author_email = undefinedprojects@outlook.com, yurifag@grzb.de
66
description = Shared libraries of erogaki wrapper python projects

0 commit comments

Comments
 (0)