Skip to content

Mapping output from WebP to PNG loads replacement code does not work #469

@erikyo

Description

@erikyo

Bug Description

I know the main intent was to provide a replacement jpeg->webp but for an ecommerce I had to change the normal operation of the plugin (otherwise it would have been of little use since the images were almost all png with transparency)

Steps to reproduce

  1. Add the filter
add_filter('webp_uploads_upload_image_mime_transforms', function() {
    return array(
        'image/png' => array( 'image/png', 'image/webp' ),
        'image/webp' => array( 'image/webp', 'image/png' ),
    );
});
  1. Create a page and upload a bunch of png images
  2. When you view that page and the fallback script is activated it tries to replace images jpg images only

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionAnything that needs a discussion/agreement[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin only[Type] BugAn existing feature is broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions