(content)
| 567 | |
| 568 | |
| 569 | def decode_base64_to_image(content): |
| 570 | if content.startswith('http') or content.startswith( |
| 571 | 'oss') or os.path.exists(content): |
| 572 | return content |
| 573 | |
| 574 | from PIL import Image |
| 575 | image_file_content = base64.b64decode(content, '-_') |
| 576 | return Image.open(BytesIO(image_file_content)) |
| 577 | |
| 578 | |
| 579 | def decode_base64_to_audio(content): |