Attempt to convert PIL.Image.Image to base64 data uri
(obj)
| 328 | |
| 329 | @staticmethod |
| 330 | def encode_as_pil(obj): |
| 331 | """Attempt to convert PIL.Image.Image to base64 data uri""" |
| 332 | image = get_module("PIL.Image") |
| 333 | if image is not None and isinstance(obj, image.Image): |
| 334 | return ImageUriValidator.pil_image_to_uri(obj) |
| 335 | else: |
| 336 | raise NotEncodable |
| 337 | |
| 338 | |
| 339 | class NotEncodable(Exception): |
nothing calls this directly
no test coverage detected