Skip to content

Modern Image Format no crop, if crop is array #1881

@1ucay

Description

@1ucay

Hi, I just discover bug, if you have array in crop

    add_image_size( 'custom-size', 220, 220, array( 'left', 'top' ) );

or

    add_filter( 'pre_option_medium_crop', function() { return array( 'center', 'center' ); } );

bug is in function webp_uploads_generate_image_size()

    if ( isset( $sizes[ $size ]['crop'] ) ) {
        $size_data['crop'] = (bool) $sizes[ $size ]['crop'];

wp image editor accept array or bool
https://developer.wordpress.org/reference/classes/wp_image_editor/resize/

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is broken

    Type

    No type

    Projects

    Status

    Done 😃

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions