Problems with photo conversion of AVIF format uploaded to discourse

AI-generated summary

The discussion revolves around issues with uploading AVIF format images to Discourse. ariznaf reports that when an AVIF file containing a photo in a linear profile (e.g., Rec2020 linear profile with 10-bit per channel) is uploaded, the generated miniature previews appear too dark, suggesting that the conversion software does not recognize the embedded linear profile. However, the original uploaded file displays correctly when viewed in full screen. supermathie confirms that the problem lies with Imagemagick, which only supports embedded profiles in TIFF, JPEG, and PDF, not AVIF. ariznaf notes that using Adobe RGB in AVIF files seems to work, and WebP format also displays correctly. The issue appears to be a lack of support for AVIF files with linear profiles in the conversion software.

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?

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.

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.