Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#62174 assigned enhancement

Sending .avif image files refused in the editor

Reported by: nightangel's profile NightAngel Owned by: adamsilverstein's profile adamsilverstein
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.6.2
Component: Media Keywords: reporter-feedback
Focuses: ui Cc:

Description

Hi !

I can upload image files in .avif format perfectly in the upload section. On the other hand, I can't upload them directly from the editor... either in an image frame or in a gallery frame.

Good day !

Attachments (2)

avif-upload.mp4 (5.9 MB) - added by adamsilverstein 4 months ago.
Monosnap 10 2024-10-11 08-57-21.jpg (31.8 KB) - added by adamsilverstein 4 months ago.

Change History (14)

#1 follow-up: @ecomzone
4 months ago

which editor are you using ?

#2 in reply to: ↑ 1 @NightAngel
4 months ago

Replying to ecomzone:

which editor are you using ?

The native editor... Gutenberg... https://ibb.co/6yDmFX5

This ticket was mentioned in Slack in #core by poena. View the logs.


4 months ago

#4 @peterwilsoncc
4 months ago

  • Component changed from Editor to Media

I've been able to reproduce this:

  1. Create new post
  2. Insert image block
  3. Click the upload button
  4. Unable to select an AVIF image

cc @adamsilverstein

#5 follow-up: @adamsilverstein
4 months ago

  • Owner set to adamsilverstein
  • Status changed from new to assigned

Hi @NightAngel thanks for the bug report - and thanks @peterwilsoncc for the confirmation.

Can you please check the output under Tools->Site Health->Info->Media to see if your server is using Imagick or GD, and look for "AVIF" in the list of supported formats.

If your server doesn't support AVIF, you should be prevented from uploading it in both places, or if it does support AVIF you should be able to upload in both places. Clearly this is not working correctly!

#6 in reply to: ↑ 5 @NightAngel
4 months ago

Replying to adamsilverstein:

Hi @NightAngel thanks for the bug report - and thanks @peterwilsoncc for the confirmation.

Can you please check the output under Tools->Site Health->Info->Media to see if your server is using Imagick or GD, and look for "AVIF" in the list of supported formats.

If your server doesn't support AVIF, you should be prevented from uploading it in both places, or if it does support AVIF you should be able to upload in both places. Clearly this is not working correctly!

Informations : https://ibb.co/fHjkfdS

I can confirm that it is indeed possible to select and send .avif files directly in media, whereas it is not possible to select them from the editor.

#7 @adamsilverstein
4 months ago

Informations : https://ibb.co/fHjkfdS

Nice: looks like you have AVIF support in both GD and Imagick!

I can confirm that it is indeed possible to select and send .avif files directly in media, whereas it is not possible to select them from the editor.

Thanks for the additional details, I will take a look.

#8 @adamsilverstein
4 months ago

  • Keywords reporter-feedback added

I've been able to reproduce this:

@peterwilsoncc can you verify you have AVIF support under Tools->Site Health->Info->Media

I can confirm that it is indeed possible to select and send .avif files directly in media, whereas it is not possible to select them from the editor.

@NightAngel - I wasn't able to reproduce this, AVIF uploading and insertion works fine for me. I am uploading a screencast. I also checked and all of the sub-sized images were generated correctly.

A couple of follow up questions:

  • Do you get an error if you try to drag and drop an image onto the editor?
  • are you unable to select avif images, or get an error uploading?
  • do you have Gutenberg or any image optimization plugins enabled - if so can you try disabling them temporarily to see if the problem persists?

#9 @NightAngel
4 months ago

Now I'm beginning to understand what's going on !

When I click on "Browse" to upload a file to the media library, WordPress is ready to accept file types other than images : https://ibb.co/ZWWpFZh

However, when I click on "Browse" to upload a file in the editor, WordPress wants me to select an image file.
For some reason, Firefox 132.0b6 doesn't consider .avif to be an image file.
Please note the drop-down menu at the bottom of my screenshot : https://ibb.co/jGt0NMQ

All this to say that if my train of thought is correct, then the problem lies with Firefox, which doesn't consider .avif to be an image. If I use the bottom drop-down menu to select “all files” then .avif becomes selectable.

I hope I've made myself sufficiently clear...

Have a nice day.

Paul.

#10 @peterwilsoncc
4 months ago

@adamsilverstein I've confirmed my server supports AVIF images (they upload and resizes generated) but I think you're right, the reproduction was due to my system, specifically because I was using Firefox.

If I attempt to upload via the post editor's image block using Safari, I can upload the images. It fails in Firefox as the upload button indicates support for image/* and Firefox does not recognise the file extension as such.

#11 @motylanogha
4 months ago

It seems that the issue with uploading .avif files in the editor is primarily browser-related, specifically with Firefox not recognising .avif as an image format. A simple workaround would be for users to manually select "All files" in the file selection dialogue when using Firefox to upload .avif files.

It may be helpful to add browser compatibility notices for Firefox users or explore an enhancement that could detect this behaviour and adjust the MIME type handling for .avif in the editor.

#12 @adamsilverstein
4 months ago

Thanks for the update here and additional testing. Lets leave this open to see if there is a way to fix the actual issue preventing uploading. As a next step I will try to reproduce this locally, then check to see if we are setting an allowed list or type in the editor and not in the media library.

Note: See TracTickets for help on using tickets.