<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg" -->

---
title: I Kept Fixing the Same HEIC Upload Bug. Here’s the...
description: HEIC images from iPhones fail to preview or process in non-Safari browsers because Chrome, Firefox, and Edge lack native HEIC decode support due to HEVC/H.265...
canonical: https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I Kept Fixing the Same HEIC Upload Bug. Here’s the Client-Side Fix That Actually Works. | daily.dev
og:description: HEIC images from iPhones fail to preview or process in non-Safari browsers because Chrome, Firefox, and Edge lack native HEIC decode support due to HEVC/H.265...
og:url: https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg
og:image: https://api.daily.dev/og/posts/k7Vf1QlqG.png
og:image:alt: I Kept Fixing the Same HEIC Upload Bug. Here’s the Client-Side Fix That Actually Works.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Kept Fixing the Same HEIC Upload Bug. Here’s the Client-Side Fix That Actually Works.

**[Medium](https://daily.dev/sources/medium_js)** · 5 min read · 1 upvotes · 1 comments

## Summary

HEIC images from iPhones fail to preview or process in non-Safari browsers because Chrome, Firefox, and Edge lack native HEIC decode support due to HEVC/H.265 patent licensing costs. The fix is running a WASM-compiled libheif decoder client-side, using libraries like heic2any or libheif-js, to convert HEIC to JPEG before running standard compression or resizing pipelines. Trade-offs include slower decode times, added bundle size, multi-image HEIC containers (bursts/Live Photos) silently dropping content, and unreliable file extensions requiring magic-byte detection instead.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@vijaykanna1200/i-kept-fixing-the-same-heic-upload-bug-heres-the-client-side-fix-that-actually-works-c89fd3f1bb9c>

## Questions this post answers

### Why do HEIC photos from an iPhone fail to display when uploaded to a website in Chrome or Firefox?

Chrome, Firefox, and Edge have no native HEIC decode support in <img> tags or Canvas, so a HEIC file dropped into an <img src> typically fails to render. Only Safari has full native support since Apple controls both the format and the browser. The root cause is that HEVC/H.265, the codec HEIC is built on, carries patent licensing costs that other browser vendors have been reluctant to absorb.

_daily.dev surfaces practical fixes like this for developers debugging cross-browser upload quirks._

### How do you convert a HEIC file to JPEG in the browser using JavaScript?

Use a WASM-compiled decoder such as heic2any or libheif-js, since browsers lack a native HEIC decode step for canvas.drawImage() or createImageBitmap() to rely on. The heic2any library wraps this: pass the file blob with a target type of image/jpeg and a quality setting, await the converted blob, then run normal compression or resizing on the resulting JPEG.

_Developers building upload pipelines can find hands-on solutions like this through daily.dev._

### What are the downsides of using a WASM decoder like heic2any for HEIC image conversion?

WASM-based HEIC decoding is noticeably slower than native format decoding, especially on large files or older devices, and the decoder itself adds real weight to the bundle, so lazy-loading it only when a HEIC file is detected helps. Multi-image HEIC containers, which can hold bursts or Live Photos, may silently drop content if you naively decode only the first image.

_daily.dev helps developers weigh trade-offs like this before picking an image-upload strategy._

## Community discussion

Top comments from developers on daily.dev.

**@nerdalytics** · 4 upvotes

> Inspired!
>
>
> Just needed in a current client project. Perfect timing to bring that up.

## Similar posts on daily.dev

- [Fix HEIC images not loading in Ubuntu 26.04 LTS](https://daily.dev/posts/fix-heic-images-not-loading-in-ubuntu-26-04-lts-ovreedjjz) · omg\! ubuntu\! · 0 upvotes · 0 comments
- [Call for Testing: client-side media processing](https://daily.dev/posts/call-for-testing-client-side-media-processing-tj6xldh7j) · Make WordPress Core · 1 upvotes · 1 comments
- [I guess I'm using WebP now?](https://daily.dev/posts/i-guess-i-m-using-webp-now--rgsorjs7s) · Hacker News · 14 upvotes · 7 comments
- [Switching my website images from WebP to AVIF](https://daily.dev/posts/switching-my-website-images-from-webp-to-avif-cxnwiilat) · Blogging and all that Malarkey · 18 upvotes · 5 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#webassembly](https://daily.dev/tags/webassembly), [#image-processing](https://daily.dev/tags/image-processing)

[View this post on daily.dev](https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I Kept Fixing the Same HEIC Upload Bug. Here’s the Client-Side Fix That Actually Works.","url":"https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg"},"datePublished":"2026-09-09T22:12:40.366Z","dateModified":"2026-09-14T06:44:43.949Z","description":"HEIC images from iPhones fail to preview or process in non-Safari browsers because Chrome, Firefox, and Edge lack native HEIC decode support due to HEVC/H.265...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/167903434f41c4e792d3f6af47cc677b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/167903434f41c4e792d3f6af47cc677b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"javascript,webassembly,image-processing","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"I Kept Fixing the Same HEIC Upload Bug. Here’s the Client-Side Fix That Actually Works."}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg","comment":[{"@type":"Comment","text":"Inspired!\nJust needed in a current client project. Perfect timing to bring that up.","datePublished":"2026-09-13T06:34:35.160Z","url":"https://daily.dev/posts/k7Vf1QlqG#c-UmEX41HpY","author":{"@type":"Person","name":"nerdalytics","url":"https://daily.dev/nerdalytics","image":"https://avatars.githubusercontent.com/u/97166791?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-kept-fixing-the-same-heic-upload-bug-here-s-the-client-side-fix-that-actually-works--k7vf1qlqg#faq","mainEntity":[{"@type":"Question","name":"Why do HEIC photos from an iPhone fail to display when uploaded to a website in Chrome or Firefox?","acceptedAnswer":{"@type":"Answer","text":"Chrome, Firefox, and Edge have no native HEIC decode support in \u003cimg\u003e tags or Canvas, so a HEIC file dropped into an \u003cimg src\u003e typically fails to render. Only Safari has full native support since Apple controls both the format and the browser. The root cause is that HEVC/H.265, the codec HEIC is built on, carries patent licensing costs that other browser vendors have been reluctant to absorb. daily.dev surfaces practical fixes like this for developers debugging cross-browser upload quirks."}},{"@type":"Question","name":"How do you convert a HEIC file to JPEG in the browser using JavaScript?","acceptedAnswer":{"@type":"Answer","text":"Use a WASM-compiled decoder such as heic2any or libheif-js, since browsers lack a native HEIC decode step for canvas.drawImage() or createImageBitmap() to rely on. The heic2any library wraps this: pass the file blob with a target type of image/jpeg and a quality setting, await the converted blob, then run normal compression or resizing on the resulting JPEG. Developers building upload pipelines can find hands-on solutions like this through daily.dev."}},{"@type":"Question","name":"What are the downsides of using a WASM decoder like heic2any for HEIC image conversion?","acceptedAnswer":{"@type":"Answer","text":"WASM-based HEIC decoding is noticeably slower than native format decoding, especially on large files or older devices, and the decoder itself adds real weight to the bundle, so lazy-loading it only when a HEIC file is detected helps. Multi-image HEIC containers, which can hold bursts or Live Photos, may silently drop content if you naively decode only the first image. daily.dev helps developers weigh trade-offs like this before picking an image-upload strategy."}}]}
```

