# HEVC images and error message Discourse::InvalidAccess

**URL:** https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964
**Category:** Feature
**Created:** [December 8, 2023, 12:55pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964 "2023-12-08T12:55:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [December 8, 2023, 12:55pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964/1 "2023-12-08T12:55:17Z")

</div>

Hello all,

I tried to upload some images into a post and always got the message `Discourse::InvalidAccess`.

When I looked closer, I noticed that the JPG files use the HEVC compression. Then I remembered that I made the photos with an iPhone and edited the photos before sending them out via email.  
Uploading the photos after resaving them as JPG file on Windows worked. So it has to be something with the HEVC compression. Maybe the file extension `.jpeg` which Apple Mail chose is not okay, too?

Anyway, the error message is not user friendly when it comes to “normal” users. Is there a way to change that?

Also, is it possible to support HEVC in Discourse?

Regards

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 8, 2023, 1:29pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964/2 "2023-12-08T13:29:21Z")

</div>

Images with HEVC compression already work in Discourse, they are converted to JPG in the backend. But those should be properly identified with the .heif extension.

AFAIK having HEVC compression in a JPG container is not valid.

Can you try to take a picture from your phone in HEVC and upload it directly here?

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [December 8, 2023, 1:52pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964/3 "2023-12-08T13:52:52Z")

</div>

That’s interesing, thank you!

> [@Falco](#):
>
> Can you try to take a picture from your phone in HEVC and upload it directly here?

I could rename on of those photos I mentioned and try to upload with `.heif` extension? Would that be useful (first)?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 8, 2023, 1:58pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964/4 "2023-12-08T13:58:29Z")

</div>

Images that have been manipulated and transformed by one of more programs may just be invalid. I suggest taking a picture with your phone and trying to upload that, which is the flow that is common for most users.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [December 8, 2023, 2:55pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964/5 "2023-12-08T14:55:27Z")

</div>

> [@Falco](#):
>
> Images that have been manipulated and transformed by one of more programs may just be invalid.

Well, but that is the typical usecase. 😉 So it should work in my eyes.

> [@Falco](#):
>
> I suggest taking a picture with your phone and trying to upload that, which is the flow that is common for most users.

I will try. Later. The iPhone is at home.

And I will also try to edit a photo and upload it. It is also interesting for me to know where the problem comes from.

But as I said, it is not something total uncommon what happened here… Starting with never altering the file extension, as everything happened on the iPhone.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [December 8, 2023, 4:23pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964/6 "2023-12-08T16:23:32Z")

</div>

Test, photo from iPhone

 ![IMG_1018](https://global.discourse-cdn.com/meta/original/4X/8/b/b/8bbf17e3b71b807c969a73fcc32e6599451c3bdb.jpeg)

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [December 8, 2023, 4:26pm UTC](https://meta.discourse.org/t/hevc-images-and-error-message-discourse-invalidaccess/287964/7 "2023-12-08T16:26:43Z")

</div>

One of the photos I talked about in my first post, renamed as `.heic`:

 ![original-1D37C8CB-3FB9-4542-AE38-550D274E858B](https://global.discourse-cdn.com/meta/original/4X/7/c/2/7c2499730f6cf730efa542b98c136f91f1d2fb47.jpeg)

If I try to upload it as `.jpeg` I get:

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/1/e/f1e1d544c8a1c47bc2877883b39d2f8da7a5aaa5.png)

Interesting. And a different message than what I got in my own forum. And because the photo with the USB sticks is also HEVC/HEIC, but uploaded as `IMG_1018.jpg` (I was able to see this when it was uploaded).

Something is strange here…
