图像数据作为缓冲区存储在博客 URL 中。现在我想获取该缓冲区数据并将其转换为 base64 URL 并将此 URL 用作图像的源。它在数据库中看起来像这样:
photo:Object
data:Binary('/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAsICAoIBwsKCQoNDAsNERwSEQ8PESIZGhQcKSQrKigkJyctMkA3LTA9MCcnOEw5PUNF...', 0)
contentType:"image/jpeg"
The schema looks like this:
photo: {
data: Buffer,
contentType: String
},
我试图转换它,但没有这样做。请帮忙。谢谢!