We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 629d3f6 commit 59811e5Copy full SHA for 59811e5
bash_kernel/display.py
@@ -103,13 +103,12 @@ def display_data_for_image(filename):
103
image = f.read()
104
_unlink_if_temporary(filename)
105
image_type = filetype.image_match(image).extension
106
- if image_type is None:
+ if image_type not in ("png", "jpeg", "gif", "webp"):
107
raise ValueError("Not a valid image: %s" % image)
108
109
- image_data = base64.b64encode(image).decode('ascii')
110
content = {
111
'data': {
112
- 'image/' + image_type: image_data
+ 'image/' + image_type: image
113
},
114
'metadata': {}
115
}
0 commit comments