Fixes to image serializations

This commit is contained in:
Don Jayamanne
2021-09-16 16:27:44 -07:00
parent 1eb4ff560b
commit 192e689be1

View File

@@ -276,7 +276,7 @@ function convertOutputMimeToJupyterOutput(mime: string, value: Uint8Array) {
if (typeof Buffer !== 'undefined' && typeof Buffer.from === 'function') {
return Buffer.from(value).toString('base64');
} else {
return btoa(value.reduce((s: string, b: number) => s + String.fromCharCode(b), ''));
return window.btoa(value.reduce((s: string, b: number) => s + String.fromCharCode(b), ''));
}
} else if (mime.toLowerCase().includes('json')) {
const stringValue = textDecoder.decode(value);