Fix svg size

This commit is contained in:
Edward Shen 2021-10-27 02:27:44 -07:00
parent 06a9522514
commit 364a467626
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -124,7 +124,9 @@ function createBlobPasteUi(data) {
function createImagePasteUi({ expiration, data, file_size }) { function createImagePasteUi({ expiration, data, file_size }) {
createMultiMediaPasteUi("img", expiration, data, (downloadEle, imgEle) => { createMultiMediaPasteUi("img", expiration, data, (downloadEle, imgEle) => {
imgEle.onload = () => { 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;
} }
}); });
} }