summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes/image-edit.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-admin/includes/image-edit.php
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-admin/includes/image-edit.php')
-rw-r--r--wp-admin/includes/image-edit.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php
index 739b09f..2d150e6 100644
--- a/wp-admin/includes/image-edit.php
+++ b/wp-admin/includes/image-edit.php
@@ -390,6 +390,12 @@ function wp_stream_image( $image, $mime_type, $attachment_id ) {
return imagewebp( $image, null, 90 );
}
return false;
+ case 'image/avif':
+ if ( function_exists( 'imageavif' ) ) {
+ header( 'Content-Type: image/avif' );
+ return imageavif( $image, null, 90 );
+ }
+ return false;
default:
return false;
}
@@ -494,6 +500,11 @@ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
return imagewebp( $image, $filename );
}
return false;
+ case 'image/avif':
+ if ( function_exists( 'imageavif' ) ) {
+ return imageavif( $image, $filename );
+ }
+ return false;
default:
return false;
}