Table of contentsClick link to navigate to the desired location
This content has been automatically translated from Ukrainian.
Modern iPhones and some Android devices take photos in HEIC (High Efficiency Image Coding) format — this is a new image standard that allows you to store high-quality photos in a smaller size than the usual JPEG. Efficient, right? But there are a few important nuances associated with this format.
Browser Support
HEIC is not supported by all browsers. For example:
- ✅ Safari (on macOS and iOS) supports HEIC.
- ❌ Chrome, Firefox, Edge — do not support HEIC directly.
So if you upload a HEIC file to a website and try to display it — users in most browsers simply won’t see the images.
Common Problem: Users Simply Change .heic → .jpg
To pass HTML validation when uploading an image (for example, through <input type="file" accept="image/jpeg">), some users simply rename the file from photo.heic to photo.jpg.
And, unfortunately, the browser doesn’t always detect this right away.
What happens next?
- The server or frontend thinks it’s a .jpg, but cannot process it.
- Errors may occur when processing the image, generating thumbnails, or viewing in the browser.
- And worst of all — such files can "break" the image pipeline on the website.
What to Do (for Developers)
- On the frontend, check not only the file extension but also the MIME type (file.type).
- When validating on the backend, analyze the file content or use libraries that accurately determine the format.
- Notify users about supported formats.
- When jpg upload doesn’t work - during debugging, check the mime-type. This Trojan horse can take time, so it’s better to look inside right away.
HEIC is a modern and efficient format, but it is still not supported everywhere. Changing the file extension is not a format conversion, and it creates more problems than it solves. If you are a developer — check the format at the content level. If you are a user — it’s better to use a converter than to change the name.
This post doesn't have any additions from the author yet.