CLOVIS
08/17/2021, 4:08 PMByteArray
that contains the binary data of an image (image/png
).
I'm trying to display that image to the user.
So far I have:
val blob = Blob(arrayOf(data), BlobPropertyBag(
type = "image/png",
))
val url = URL.createObjectURL(blob)
window.open(url, target = "_blank", features = "noopener,noreferrer")
However, running the code opens a tab with a small grey square, no matter the original image. I think the blob conversion is the culprit, but I'm honestly not sure. Because Blob
takes an Array<dynamic>
, I have no meaningful way of knowing what's wrong with it.turansky
08/17/2021, 4:18 PMturansky
08/17/2021, 5:21 PMCLOVIS
08/17/2021, 6:07 PM