diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 3e448d6..d64d886 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -278,22 +278,10 @@ class PeersUI { if (files[0].type.split('/')[0] === 'image') { try { - let image = files[0] + let imageUrl = await getThumbnailAsDataUrl(files[0], 80, null, 0.9); - // Heic files can't be shown by browsers natively --> convert to jpeg - if (image.type === "image/heif" || image.type === "image/heic") { - let blob = await fileToBlob(image); - image = await heic2any({ - blob, - toType: "image/jpeg", - quality: 0.9 - }); - } - - let imageUrl = URL.createObjectURL(image); this.$shareModeImageThumb.style.backgroundImage = `url(${imageUrl})`; - await waitUntilImageIsLoaded(imageUrl); this.$shareModeImageThumb.removeAttribute('hidden'); } catch (e) { console.error(e); diff --git a/public/styles/deferred-styles.css b/public/styles/deferred-styles.css index eb574f9..95a53ca 100644 --- a/public/styles/deferred-styles.css +++ b/public/styles/deferred-styles.css @@ -661,19 +661,18 @@ x-dialog .dialog-subheader { margin-right: 6px; } -.shr-panel .text-thumb svg { +.shr-panel .thumb > .text-thumb > svg { width: 18px; height: 36px; } -.shr-panel .file-thumb svg { +.shr-panel .thumb > .file-thumb > svg { width: 36px; height: 36px; } -.shr-panel .thumb .image-thumb { +.shr-panel .thumb > .image-thumb { background-size: cover; - border-radius: 6px; background-position: center; }