From 904862da90c8aaea42c81e247d57df6a08d50231 Mon Sep 17 00:00:00 2001 From: desrosj Date: Thu, 15 Jul 2021 17:39:59 +0000 Subject: [PATCH] Media: Document edge cases with the new `image_editor_output_format` filter. More testing has revealed that the `image_editor_output_format` filter has some interesting edge cases that developers should be aware of when electing to use this filter (see #53667 and #53668). Because this is a new filter that was intended to be used for experimenting with different ways to handle generating image sizes and has not yet been adopted in the wild, expanding the inline documentation is an acceptable temporary solution while these edge cases are explored further and addressed. Props mikeschroder, antpb, desrosj, adamsilverstein, ianmjones. See #5366, #53668, #35725. Built from https://develop.svn.wordpress.org/trunk@51442 git-svn-id: http://core.svn.wordpress.org/trunk@51053 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor.php | 13 +++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index a4aa8434d6..11210180b2 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -322,6 +322,19 @@ abstract class WP_Image_Editor { * Enables filtering the mime type used to save images. By default, * the mapping array is empty, so the mime type matches the source image. * + * This should be considered experimental as there are a few edge cases that + * still need to be solved. + * + * When this filter is used in combination with the {@see 'wp_editor_set_quality'} + * filter, the image quality value used will be that of the original mime type, + * not the mapped one. This could result in unexpected image quality for generated + * images. See https://core.trac.wordpress.org/ticket/53667 for more details. + * + * When a mime type is mapped to another, and two images with the same name are + * uploaded (image.jpg and image.webp, for example), the generated images for one + * will potentially overwrite the other's. + * See https://core.trac.wordpress.org/ticket/53668 for more details. + * * @see WP_Image_Editor::get_output_format() * * @since 5.8.0 diff --git a/wp-includes/version.php b/wp-includes/version.php index ad9c6729e3..c5bdfcc271 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51440'; +$wp_version = '5.9-alpha-51442'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.