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.
The file should be uploaded
The media manager should be adjusted to allow uploading AVIF images.
No Code Attached Yet
@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"?
Joomla Administrator > Content > Media > Options
Tried to upload an AVIF image.
Concluding two things:
Added MIME type
image/heif. Uploading an AVIF image is not possible with the same error message as mentioned earlier
What happens if you switch off "Check MIME Types" in media manager options?
Yes, but I wanted to know what happens when the MIME type check is switched off.
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?
The MIME type is determined in the MediaHelper class here:
For images, following functions are used if available, one after the other:
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.
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.
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 .