Open mgearh opened 3 years ago
Also SVG format doesn't being transfered. Thanks
It's 2024. All browsers support WEBP for some time now and AV1 is around the corner. IMHO it is essential to support those. WEBP already saves 42% in size on average compared to JPEG. Maybe that is why in #1144 the same issue is labelled as bug? 🤓 Why filter on file type at all? If it's in the Media Library WordPress will be able to handle it? But I'm no developer so this might be naive.
Notes from the changeset https://core.trac.wordpress.org/changeset/50810 that implemented WebP support for https://core.trac.wordpress.org/ticket/35725, released in WP 5.8:
image/webp
if function_exists( 'imagecreatefromwebp' )
or function_exists( 'imagewebp' )
image/webp
.webp
IMAGETYPE_WEBP
and IMG_WEBP
Notes from current WordPress image support:
'avif' => 'image/avif'
'heic' => 'image/heic'
Other notes:
webp
— We're probably fine to enable WebP by defaultdt_
dt_allowed_media_extensions
filter which has a separate list of IDsupload_mimes
in https://developer.wordpress.org/reference/functions/get_allowed_mime_types/ uses the array format shown in the source of https://developer.wordpress.org/reference/functions/wp_get_mime_types/ of ['a regex' => 'mime/type', ...]
, which is the same format that 10up's filter uses.@meksone SVG support and integration with https://github.com/10up/safe-svg seems like it would be a separate issue, since WordPress does not natively support SVG. I've opened a separate issue to track that: https://github.com/10up/distributor/issues/1268
Is your enhancement related to a problem? Please describe.
Yes, when distributing posts that are using a WEBP featured image, the image does not transfer.
Describe the solution you'd like
For the plugin to support the WEBP format.
Designs
Describe alternatives you've considered
Additional context