Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#61167 assigned defect (bug)

AVIF image thumbnail not created !

Reported by: joomskys's profile joomskys Owned by: adamsilverstein's profile adamsilverstein
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5
Component: Media Keywords: avif image thumbnail dev-feedback reporter-feedback
Focuses: Cc:

Description

Thank you all the team for this great feature.
i have issue when i try to use AVIF image, can you help?
the issue is:

i have AVIF image file,
i uploaded it to wordpress via Media Upload -> https://prnt.sc/54s8JQoSWgfl
image upload completed -> https://prnt.sc/QZmqQiCD-R63
BUT the image thumbnail size like : thumbnail, medium, large, … NOT CREATED ! -> https://prnt.sc/A54F2cFUsHBH
can you look and help ?
am using siteground web hosting!
Thanks

Attachments (5)

Julie Gold Earrings.avif (8.4 KB) - added by joomskys 6 weeks ago.
error-uploading-in-media-library.jpg (154.8 KB) - added by adamsilverstein 6 weeks ago.
server-lacks-avif-support.jpg (224.0 KB) - added by adamsilverstein 6 weeks ago.
AVIF-upload-test.jpg (1.4 MB) - added by adamsilverstein 6 weeks ago.
Monosnap Edit Post “test avif” ‹ My... Website — WordPress 2024-05-08 12-46-02.jpg (46.9 KB) - added by adamsilverstein 6 weeks ago.

Download all attachments as: .zip

Change History (14)

This ticket was mentioned in Slack in #core-performance by spacedmonkey. View the logs.


6 weeks ago

#2 follow-ups: @adamsilverstein
6 weeks ago

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

Hey @joomskys - thanks for the bug report and sample image.

I gave your image a test on my server that has AVIF support enabled and the srcset entries were created, which means it is likely your server lacks AVIF support.

Can you check to see if your media handling includes AVIF? Look under Tools->Site Health->Info->Media and check which media editor and formats are supported (search for "AVIF").

I tested again on a site that lacks AVIF support and got the behavior you described - I was able to upload the image, but no subsizes were created.

Interestingly, when I tried uploading the AVIF file in the Media library, I got an error message "This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading." and the image refuxed to upload. So this does feel like a bug to me, the behavior should be consistent - the bug is likely on the Gutenberg (rather than core) side though - the editor should reject your AVIF file when you try to upload it on a site that lacks AVIF support.

am using siteground web hosting!

Great, you can ask them about enabling AVIF for your site! It may be available only on certain plans or they may need to hear requests from enough customers wanting it to add support.

Last edited 6 weeks ago by adamsilverstein (previous) (diff)

#3 @adamsilverstein
6 weeks ago

the bug is likely on the Gutenberg (rather than core) side though - the editor should reject your AVIF file when you try to upload it on a site that lacks AVIF support.

Correction: looks like we bootstrap the available mime types from the WordPress side. We should be able to address this in core.

This ticket was mentioned in PR #6531 on WordPress/wordpress-develop by @adamsilverstein.


6 weeks ago
#4

  • Keywords has-patch added

#5 @adamsilverstein
6 weeks ago

  • Keywords has-patch removed

I created this PR which should disable AVIF uploading on sites where AVIF isn't supported by the server.

Testing in Gutenberg, after this patch I get a warning message on my server that does not support AVIF and I cannot upload the test image.

I expanded the check to include WebP since a small percentage of servers still don't support that format. Checking every format seems excessive.

Last edited 6 weeks ago by adamsilverstein (previous) (diff)

@adamsilverstein commented on PR #6531:


6 weeks ago
#6

## Testing instructions

  • Use the WordPress playground build above
  • Try uploading an AVIF image (see the Trac ticket for a sample image)

#7 @adamsilverstein
6 weeks ago

  • Component changed from Upload to Media
  • Keywords dev-feedback reporter-feedback added

#8 in reply to: ↑ 2 @azaozz
6 weeks ago

Replying to adamsilverstein:

I got an error message "This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading." and the image refuxed to upload.

Yea this is a bug and needs fixing. Most likely it's a "left over" from the initial implementation of error messages about AVIF files few years ago when they weren't supported in the web browsers.

Looking at https://github.com/WordPress/wordpress-develop/pull/6531: thinking it would be better to show a better error message that explains exactly what's wrong (server not able to work with these images) and tell the users to convert the file before uploading it. Perhaps the same text as in the JS error?

Or maybe implement that error in JS in Gutenberg, and keep the change to allowedMimeTypes in case an unsupported image is uploaded by other means.

Last edited 6 weeks ago by azaozz (previous) (diff)

#9 in reply to: ↑ 2 @joomskys
6 weeks ago

Replying to adamsilverstein:

Thank for your watching,
i will contact and request support from my hosting provider!

Best Regard

Last edited 6 weeks ago by joomskys (previous) (diff)
Note: See TracTickets for help on using tickets.