Problems with photo conversion of AVIF format uploaded to discourse

Avif is supported by discourse by quite a while.

I have tried avif and it works well generally.

But the conversion of avif files does not work well when the avif file contains a photo in a linear profile (at least with rec2020 lineal profile and a 10 bit per channel file).

When you upload the photo it is displayed correctly, but after the system prepares the miniature previews, the previe of the file in the post is substituted by an image that is too dark.
That is typical of software that does not support lineal profiles.
It seems that the conversion software that generates the previews does not recognize the embeded lineal profile.

When you click in it an see it full screen in the light table you see it correctly (as it is the original uploaded file).
Here is an example:

It seems that it works correctly with webp format.
This is the same photo with embeded rec2020 lineal profile in webp and it displays correctly.

Is it a bug?
Is it some misconfiguration in our site?
Has anyone experimented the same problem?

1 Like

Do you mean linear profiles here?

Indeed, the problem apears to be that Imagemagick only supports embedded profiles in TIFF, JPEG, and PDF.

If I open it up using IM I see the same dark image.

2 Likes

Yes I mean linear profiles.

The avif file uploaded is in Rec2020 lineal which is included in the image.

It seems that the conversion software ignores the gamma curve provided and uses one of its own with gamma applied.

It seems it does not support AVIF files correctly. WebP seems to work well.

Using Adobe RGB in avif file seems to work.

The file was generated using dartable export with RGB Rec. 2020 lineal profile and AVIF format with 90 compression adn 10 bits of color depth.