mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 16:53:58 +00:00
Add support for base64 image source from binary object
This commit is contained in:
@@ -504,6 +504,9 @@ export function getAsImageSrc(obj) {
|
|||||||
if (obj?.type == 'Buffer' && _isArray(obj?.data)) {
|
if (obj?.type == 'Buffer' && _isArray(obj?.data)) {
|
||||||
return `data:image/png;base64, ${arrayBufferToBase64(obj?.data)}`;
|
return `data:image/png;base64, ${arrayBufferToBase64(obj?.data)}`;
|
||||||
}
|
}
|
||||||
|
if (obj?.$binary?.base64) {
|
||||||
|
return `data:image/png;base64, ${obj.$binary.base64}`;
|
||||||
|
}
|
||||||
|
|
||||||
if (_isString(obj) && (obj.startsWith('http://') || obj.startsWith('https://'))) {
|
if (_isString(obj) && (obj.startsWith('http://') || obj.startsWith('https://'))) {
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
Reference in New Issue
Block a user