Skip to content

Commit

Permalink
Hotfix: Prevent converting HEIC images until PR #350 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
schlagmichdoch committed Feb 11, 2025
1 parent 957ca39 commit a0f88ed
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions public/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,16 @@ function getThumbnailAsDataUrl(file, width = undefined, height = undefined, qual
return new Promise(async (resolve, reject) => {
try {
if (file.type === "image/heif" || file.type === "image/heic") {
// browsers can't show heic files --> convert to jpeg before creating thumbnail
let blob = await fileToBlob(file);
file = await heic2any({
blob,
toType: "image/jpeg",
quality: quality
});
// hotfix: Converting heic images taken on iOS 18 crashes page. Waiting for PR #350
reject(new Error(`Hotfix: Converting of HEIC/HEIF images currently disabled.`));
return;
// // browsers can't show heic files --> convert to jpeg before creating thumbnail
// let blob = await fileToBlob(file);
// file = await heic2any({
// blob,
// toType: "image/jpeg",
// quality: quality
// });
}

let imageUrl = URL.createObjectURL(file);
Expand Down

0 comments on commit a0f88ed

Please # to comment.