Fix svg size

master
Edward Shen 2021-10-27 02:27:44 -07:00
parent 06a9522514
commit 364a467626
Signed by: edward
GPG Key ID: 19182661E818369F
1 changed files with 3 additions and 1 deletions

View File

@ -124,7 +124,9 @@ function createBlobPasteUi(data) {
function createImagePasteUi({ expiration, data, file_size }) {
createMultiMediaPasteUi("img", expiration, data, (downloadEle, imgEle) => {
imgEle.onload = () => {
downloadEle.textContent = "Download " + file_size + " \u2014 " + imgEle.naturalWidth + " by " + imgEle.naturalHeight;
let width = imgEle.naturalWidth || imgEle.width;
let height = imgEle.naturalHeight || imgEle.height;
downloadEle.textContent = "Download " + file_size + " \u2014 " + width + " by " + height;
}
});
}