All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

What is the HEIC format and why just rename it .jpg — is a bad idea

Post cover: What is the HEIC format and why just rename it .jpg — is a bad idea
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 the format HEIC (High Efficiency Image Coding) <TAG1> is a new image standard that allows you to store quality photos in a smaller size than the usual JPEG. Effective, right? But several important nuances are associated with this format.

Support in browsers

HEIC is not supported by all browsers. For example:
  • ✅ Safari (on macOS and iOS) supports HEIC.
  • ❌ Chrome, Firefox, Edge — do not support HEIC directly.
That is, if you download a HEIC file to the site and try to show it —, users in most browsers simply will not see images.

Frequent problem: users simply change .heic → .jpg

To pass HTML validation when loading an image (for example, through <input type="file" accept="image/jpeg">), some users just rename the file from photo.heic to photo.jpg.
And unfortunately, the browser can't always detect it right away.
What happens next?
  • The server or frontend thinks it's .jpg, but cannot process it.
  • Errors may occur when processing an image, generating thumbnails, or when viewing in a browser.
  • And worst of all, — such files can "hack" the image pipeline on the site.

What to do (developers)

  1. On the frontend check not only the file extension, but also MIME-type (file.type).
  2. Validating on the backend, analyze the contents of the file or use libraries that define the format precisely.
  3. Warn users about supported formats.
  4. When jpg download is not working - check mime-type during debugging. This Trojan horse can take time, so it's better to see what's inside right away.
HEIC — is a modern and efficient format, but not yet supported everywhere. Changing the file extension — no 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 is better to use a converter than changing the name.

This post doesn't have any additions from the author yet.

Задача на перевірку правильності розстановки дужок (Ruby)
21 May 10:27

Задача на перевірку правильності розстановки дужок (Ruby)

meme code
meme code@memecode
Як знайти підмасив з максимальною сумою (Maximum Subarray Sum) в Ruby
22 May 11:01

Як знайти підмасив з максимальною сумою (Maximum Subarray Sum) в Ruby

meme code
meme code@memecode
Google Ads for Dummies: A Step-by-Step Guide to a Successful Start
28 May 10:21

Google Ads for Dummies: A Step-by-Step Guide to a Successful Start

meme code
meme code@memecode
What jemalloc is and how it relates to Ruby /Ruby on Rails
30 May 11:53

What jemalloc is and how it relates to Ruby /Ruby on Rails

meme code
meme code@memecode
05 Jun 01:52

[Fixed] uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

meme code
meme code@memecode
The preview in the network tab became very small after updating Chrome
05 Jun 18:23

The preview in the network tab became very small after updating Chrome

meme code
meme code@memecode
Чому вибір CMS важливий під час розробки сайту?
29 Jun 12:34

Чому вибір CMS важливий під час розробки сайту?

meme code
meme code@memecode
Error 403 on the site: what it means and how to eliminate it
24 Jul 23:50

Error 403 on the site: what it means and how to eliminate it

meme code
meme code@memecode
What is vibe coding?
25 Jul 21:51

What is vibe coding?

meme code
meme code@memecode
What is a combinatorial explosion?
28 Jul 11:50

What is a combinatorial explosion?

meme code
meme code@memecode
What is a brain stack?
28 Jul 19:37

What is a brain stack?

meme code
meme code@memecode
What is integer overflow?
15 Aug 08:28

What is integer overflow?

meme code
meme code@memecode