WordPress.org

Make WordPress Core

Changeset 51442


Ignore:
Timestamp:
07/15/2021 05:38:57 PM (2 months ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor.php

    r51298 r51442  
    323323         * the mapping array is empty, so the mime type matches the source image.
    324324         *
     325         * This should be considered experimental as there are a few edge cases that
     326         * still need to be solved.
     327         *
     328         * When this filter is used in combination with the {@see 'wp_editor_set_quality'}
     329         * filter, the image quality value used will be that of the original mime type,
     330         * not the mapped one. This could result in unexpected image quality for generated
     331         * images. See https://core.trac.wordpress.org/ticket/53667 for more details.
     332         *
     333         * When a mime type is mapped to another, and two images with the same name are
     334         * uploaded (image.jpg and image.webp, for example), the generated images for one
     335         * will potentially overwrite the other's.
     336         * See https://core.trac.wordpress.org/ticket/53668 for more details.
     337         *
    325338         * @see WP_Image_Editor::get_output_format()
    326339         *
Note: See TracChangeset for help on using the changeset viewer.