Hotfix: Prevent converting HEIC images until PR #350 is fixed

This commit is contained in:
schlagmichdoch 2025-02-11 11:10:01 +01:00
parent 957ca39f90
commit a0f88ed492

View file

@ -477,13 +477,16 @@ function getThumbnailAsDataUrl(file, width = undefined, height = undefined, qual
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
try { try {
if (file.type === "image/heif" || file.type === "image/heic") { if (file.type === "image/heif" || file.type === "image/heic") {
// browsers can't show heic files --> convert to jpeg before creating thumbnail // hotfix: Converting heic images taken on iOS 18 crashes page. Waiting for PR #350
let blob = await fileToBlob(file); reject(new Error(`Hotfix: Converting of HEIC/HEIF images currently disabled.`));
file = await heic2any({ return;
blob, // // browsers can't show heic files --> convert to jpeg before creating thumbnail
toType: "image/jpeg", // let blob = await fileToBlob(file);
quality: quality // file = await heic2any({
}); // blob,
// toType: "image/jpeg",
// quality: quality
// });
} }
let imageUrl = URL.createObjectURL(file); let imageUrl = URL.createObjectURL(file);