-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
wp_plupload_default_settings() calls:
// Check if WebP images can be edited.
if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/webp' ) ) ) {
$defaults['webp_upload_error'] = true;
}
// Check if AVIF images can be edited.
if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/avif' ) ) ) {
$defaults['avif_upload_error'] = true;
}This in-turn does a Imagick::queryFormats per support, which is quite slow. E.g.
www-data@efddc66a02b9:/usr/src/app$ php -r '$start = microtime(true); var_dump( Imagick::queryFormats( "webp" ) ); var_dump( microtime( true ) - $start );'
array(0) {
}
float(0.0890190601348877)This is pretty consistent. Given these is constant, I'm wondering if we could cache / hardcode this.
There doesn't appear to be any great hooks to be able to do that but might need more investigation.
Metadata
Metadata
Assignees
Labels
No labels