Skip to content

Linked images in galleries aren't replaced #2470

@ms-studio

Description

@ms-studio

Modern Image Formats Plugin doesn't replace linked images in galleries

I just tested the Modern Image Formats plugin. It appears to work fine for single image blocks, and for galleries where the images aren't linked (link set to: none). In those cases, original images (png) are replaced by AVIF files.

However, when the image link is set to "Link images to media files" or "Enlarge on click", then the AVIF is used inside the <img> tag, but the <a href> link (to the bigger image format) is still linking to the PNG version.

Those large images would benefit the most from the size reduction of modern formats. Therefore I consider the plugin's feature isn't complete it those images aren't replaced as well.

Steps to reproduce

  1. Create a Post with an Image Gallery, and add some images.
  2. Click on the link tool and set "Link images to media files"
  3. On the page preview, inspect the source code.

Additional Context

  • Plugin Version: 2.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    ContributorDayIssues flagged as Contributor Day candidates.[Plugin] Modern Image FormatsIssues for the Modern Image Formats plugin (formerly WebP Uploads)[Type] BugAn existing feature is broken

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Not Started/Backlog 📆

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions