Fix thumbnail creation on iOS devices

This commit is contained in:
schlagmichdoch 2023-12-12 14:07:15 +01:00
parent a5cc115fa6
commit 73759be0a9
2 changed files with 4 additions and 17 deletions

View file

@ -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);

View file

@ -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;
}