Information Required No Code Attached Yet
avatar hans2103
17 Sep 2020

Steps to reproduce the issue

Go to the blog AVIF has landed by Jake Archibald and download an AVIF image.

AVIF is a new image format derived from the keyframes of AV1 video. It's a royalty-free format, and it's already supported in Chrome 85 on desktop. Android support will be added soon, Firefox is working on an implementation, and although it took Safari 10 years to add WebP support, I don't think we'll see the same delay here, as Apple are a member of the group that created AV1.

  • Login Joomla 4.0 Administrator > Content > Media
  • Try to upload the AVIF image

Expected result

The file should be uploaded

Actual result

Schermafbeelding 2020-09-17 om 10 11 46

Requested change

The media manager should be adjusted to allow uploading AVIF images.


# of Users Experiencing Issue
Average Importance Score

avatar hans2103 hans2103 - open - 17 Sep 2020
avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2020
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Sep 2020
avatar richard67
richard67 - comment - 17 Sep 2020

@hans2103 Have you added ".avif" to both the list of allowed file types "Legal Extensions (File Types)" and the list of allowed images "Legal Image Extensions (File Types)" in the media manager's options? And if "Check MIME Types" is switched on in the options, which is the default, have you also added "image/avif" to the list of allowed MIME types "Legal MIME Types"?

avatar hans2103
hans2103 - comment - 17 Sep 2020

Joomla Administrator > Content > Media > Options

  • Legal Extensions (File Types) => added ,avif,AVIF
  • Check MIME Types = YES (by default)
  • Legal Image Extensions (File Types) => added avif
  • Legal MIME Types => added 'image/avif`

Tried to upload an AVIF image.
The result:

Schermafbeelding 2020-09-17 om 10 35 07

Concluding two things:

  • there is no English translation for this text variable
  • it is not possible to upload an avif image
avatar hans2103 hans2103 - change - 17 Sep 2020
[4.0] [media manager] not possible to upload an avif image
[4.0] com_media not possible to upload an avif image
avatar hans2103 hans2103 - edited - 17 Sep 2020
avatar SharkyKZ
SharkyKZ - comment - 17 Sep 2020

The MIME type is image/heif.

avatar SharkyKZ
SharkyKZ - comment - 17 Sep 2020

For missing string issue see PR #30671.

avatar hans2103
hans2103 - comment - 18 Sep 2020

Added MIME type image/heif. Uploading an AVIF image is not possible with the same error message as mentioned earlier

avatar SharkyKZ
SharkyKZ - comment - 18 Sep 2020

Can you post a link to the image for testing?

avatar hans2103
hans2103 - comment - 18 Sep 2020

I've been using one of the avif images downloaded from the article mentioned in the description of this issue

avatar richard67
richard67 - comment - 18 Sep 2020

What happens if you switch off "Check MIME Types" in media manager options?

avatar SharkyKZ
SharkyKZ - comment - 18 Sep 2020

It's recognized as having application/octet-stream MIME type. There's PR #25351 for improving MIME detection but I don't think it's going to help in this case.

avatar richard67
richard67 - comment - 18 Sep 2020

Yes, but I wanted to know what happens when the MIME type check is switched off.

avatar SharkyKZ
SharkyKZ - comment - 18 Sep 2020

It works without MIME check.

avatar richard67
richard67 - comment - 18 Sep 2020

So the MIME check is the broken thing? Maybe it just can't handle that new format yet? Maybe our dependency needs an update for that?

avatar richard67
richard67 - comment - 19 Sep 2020

The MIME type is determined in the MediaHelper class here:

For images, following functions are used if available, one after the other:

  • exif_imagetype
  • getimagesize
  • mime_content_type
  • finfo_open

The availability of these functions depends on PHP version and available PHP extensions, and if avif images are included in the corresponding extensions or in case of mime_content_type in the magic file may depend on the particular PHP extension's version.

avatar Quy
Quy - comment - 25 Oct 2020

Please test PR #31233 using mimetype application/octet-stream.

avatar hans2103
hans2103 - comment - 27 Oct 2020

PR #31233 has already been merged.
@Quy what should I change in the settings to get an .avif file being uploaded?
The mentioned error remains

avatar Quy
Quy - comment - 27 Oct 2020

I am not at a computer to double check. Add avif to filetype and image extension settings. For the mime type please add the avif file manually to the images folder and click the info icon to see its mime type value to use for the mime type setting.

avatar Quy Quy - change - 28 Oct 2020
Labels Added: Information Required
avatar Quy Quy - labeled - 28 Oct 2020
avatar Quy
Quy - comment - 8 Jan 2021

Using application/octet-stream works for me.


avatar morsssss
morsssss - comment - 16 Jan 2021

Thanks, @brianteeman , for letting me know about this.

I imagine the problem is that Joomla doesn't support AVIF, because PHP-GD doesn't support AVIF - which is because libgd doesn't include AVIF support?

If so, I'm working on that right now. You can follow my progress (and I very much hope there will be good news soon) at libgd/libgd#557 .

Add a Comment

Login with GitHub to post a comment