File tree Expand file tree Collapse file tree
erogaki_wrapper_shared_python Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import io
2- import PIL
2+ from PIL import Image
33
44class 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
Original file line number Diff line number Diff line change 11[metadata]
22name = erogaki-wrapper-shared-python
3- version = 0.7
3+ version = 0.7.1
44author = erogaki-devs (undefinedprojects, Yurifag)
55author_email = undefinedprojects@outlook.com, yurifag@grzb.de
66description = Shared libraries of erogaki wrapper python projects
You can’t perform that action at this time.
0 commit comments