Fix toDataURL is not a function
This commit is contained in:
parent
550d1beb13
commit
bff32b2d68
1 changed files with 6 additions and 1 deletions
|
@ -2659,7 +2659,12 @@ function Card({ card, selfReferential, instance }) {
|
||||||
const imageData = ctx.createImageData(w, h);
|
const imageData = ctx.createImageData(w, h);
|
||||||
imageData.data.set(blurhashPixels);
|
imageData.data.set(blurhashPixels);
|
||||||
ctx.putImageData(imageData, 0, 0);
|
ctx.putImageData(imageData, 0, 0);
|
||||||
blurhashImage = canvas.toDataURL();
|
if (window.OffscreenCanvas) {
|
||||||
|
const blob = canvas.convertToBlob();
|
||||||
|
blurhashImage = URL.createObjectURL(blob);
|
||||||
|
} else {
|
||||||
|
blurhashImage = canvas.toDataURL();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPost = isCardPost(domain);
|
const isPost = isCardPost(domain);
|
||||||
|
|
Loading…
Add table
Reference in a new issue