PBF PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
17 Aug 2023

Allow media manager to have AVIF files uploaded and rendered

Summary of Changes

AVIF is an alternative to webp in some circumstances (see https://www.smashingmagazine.com/2021/09/modern-image-formats-avif-webp/ for more info).

I've deliberately chosen to not add this to a SQL Update script so there are no security implications for sites who may have more restrictive upload policies. This will only apply to new sites.

Worth noting this is a better fit for J5 than J4.4 because the GD library support was only added in PHP 8.1 (although technically that doesn't stop people uploading the files themselves in J4.4 as web browser support already exists - it's just easier because they can be edited too) - https://php.watch/versions/8.1/gd-avif

Testing Instructions

Upload AVIF file. Before will be rejected and any files on the server won't be rendered. Afterwards they will be.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar joomla-cms-bot joomla-cms-bot - change - 17 Aug 2023
Category Administration com_media SQL Installation
avatar wilsonge wilsonge - open - 17 Aug 2023
avatar wilsonge wilsonge - change - 17 Aug 2023
Status New Pending
avatar wilsonge wilsonge - change - 17 Aug 2023
The description was changed
avatar wilsonge wilsonge - edited - 17 Aug 2023
avatar brianteeman
brianteeman - comment - 17 Aug 2023

Does this close the following

#30666
#37669

Also see the changes made with #35752

avatar richard67
richard67 - comment - 17 Aug 2023

@wilsonge You've changed the base.sql file for MySQL but not the one for PostgreSQL. This cannot be right.

avatar wilsonge
wilsonge - comment - 17 Aug 2023

#35752 is just for the image list field (I'm not aware of anywhere we use that in core). But people would have needed to upload those files by hand. This PR specifically addresses media manager.

Yes it will address #30666. However it will only address the AVIF part of #37669 (the original issue was a broader thing around document formats etc which obviously isn't covered here)

avatar joomla-cms-bot joomla-cms-bot - change - 17 Aug 2023
Category Administration com_media SQL Installation Administration com_media SQL Installation Postgresql
avatar wilsonge wilsonge - change - 17 Aug 2023
Labels Added: PR-5.0-dev
avatar wilsonge wilsonge - change - 17 Aug 2023
The description was changed
avatar wilsonge wilsonge - edited - 17 Aug 2023
avatar Quy
Quy - comment - 17 Aug 2023

Update?

static $imageTypes = 'xcf|odg|gif|jpg|jpeg|png|bmp|webp';

'image/jpeg,image/gif,image/png,image/bmp,image/webp,application/msword,application/excel,' .

$allowable = array_map('trim', explode(',', $params->get('restrict_uploads_extensions', 'bmp,gif,jpg,jpeg,png,webp,ico,mp3,m4a,mp4a,ogg,mp4,mp4v,mpeg,mov,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,csv')));

$allowedExtensions = array_map('trim', explode(',', $params->get('restrict_uploads_extensions', 'bmp,gif,jpg,jpeg,png,webp,ico,mp3,m4a,mp4a,ogg,mp4,mp4v,mpeg,mov,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,csv')));

avatar joomla-cms-bot joomla-cms-bot - change - 23 Aug 2023
Category Administration com_media SQL Installation Postgresql Administration com_media SQL Installation Postgresql Libraries
avatar tomsrocket
tomsrocket - comment - 26 Aug 2023

I can confirm this works.

avatar MacJoom MacJoom - test_item - 26 Aug 2023 - Tested successfully
avatar MacJoom
MacJoom - comment - 26 Aug 2023

I have tested this item ✅ successfully on d0ec800

On 5.0.0-alpha4
you have to setup the file type and mime type in options


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41381.
avatar Magnytu2
Magnytu2 - comment - 26 Aug 2023

It works but doesn't produce a thumbnail in the media manager, and the instructions for adding .avif files are missing from the settings.screen shot 2023-08-26 at 13 34 54


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41381.

avatar HLeithner
HLeithner - comment - 1 Sep 2023

It works but doesn't produce a thumbnail in the media manager, and the instructions for adding .avif files are missing from the settings.screen shot 2023-08-26 at 13 34 54

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41381.

is it possible that you server doesn't support av1?

avatar brianteeman
brianteeman - comment - 1 Sep 2023

To test to see if your server supports avif see https://php.watch/versions/8.1/gd-avif

avatar wilsonge
wilsonge - comment - 1 Sep 2023

Also to check if you use patchtester you will need to manually update the parameters in media manager

avatar HLeithner HLeithner - change - 2 Sep 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-09-02 17:17:21
Closed_By HLeithner
Labels Added: PBF
avatar HLeithner HLeithner - close - 2 Sep 2023
avatar HLeithner HLeithner - merge - 2 Sep 2023
avatar HLeithner
HLeithner - comment - 2 Sep 2023

thx

Add a Comment

Login with GitHub to post a comment