Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modern Image Formats: The alternate mime type images didn't add original image extension in image name #1661

Open
mukeshpanchal27 opened this issue Nov 18, 2024 · 3 comments
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken

Comments

@mukeshpanchal27
Copy link
Member

Bug Description

While i doing smoke testing for plugin release i found that the uploaded image didn't add original image extension( -jpeg or -jpg ) in the full and sub-sizes image. For sub-size previously i reported #1560. After 6.7 the full size image also didn't get the image extension.

In #444 we added the original image's extension to the WebP file name to ensure it is unique but after 6.7 the original issue reintroduce.

Image.jpeg

<img
    fetchpriority="high"
    decoding="async"
    width="600"
    height="400"
    src="https://closebat.s1-tastewp.com/wp-content/uploads/2024/11/image.webp"
    alt=""
    class="wp-image-15"
    srcset="
        https://closebat.s1-tastewp.com/wp-content/uploads/2024/11/image.webp 600w,
        https://closebat.s1-tastewp.com/wp-content/uploads/2024/11/image-300x200.webp 300w
    "
    sizes="(max-width: 600px) 100vw, 600px"
>

Image.jpg

<img
    decoding="async"
    width="600"
    height="400"
    src="https://closebat.s1-tastewp.com/wp-content/uploads/2024/11/image-1.webp"
    alt=""
    class="wp-image-16"
    srcset="
        https://closebat.s1-tastewp.com/wp-content/uploads/2024/11/image-1.webp 600w,
        https://closebat.s1-tastewp.com/wp-content/uploads/2024/11/image-1-300x200.webp 300w
    "
    sizes="(max-width: 600px) 100vw, 600px"
>

Steps to reproduce

  1. Install and activate Modern Image Formats plugin.
  2. Upload two same name image. image.jpeg and image.jpg
  3. See frontend.

Screenshots

Image

@mukeshpanchal27 mukeshpanchal27 added [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken labels Nov 18, 2024
@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2024 Nov 18, 2024
@felixarntz
Copy link
Member

@mukeshpanchal27 Have you verified where this comes from? I'm not sure if it's really a bug in our plugin or simply happens because Core handles MIME type changes in a different way.

This problem, does it only happen when you don't use fallback images, or only when you use fallback images, or in both scenarios? This would be great to specify.

@felixarntz felixarntz added this to the webp-uploads n.e.x.t milestone Nov 18, 2024
@mukeshpanchal27
Copy link
Member Author

This problem, does it only happen when you don't use fallback images, or only when you use fallback images, or in both scenarios? This would be great to specify.

It is only happened when don't use fallback images.

@felixarntz
Copy link
Member

It is only happened when don't use fallback images.

In that case, I assume this is simply because Core is now handling the migration. To be fair, it already did before for images above the "big image threshold", so this isn't even entirely new behavior, we just never caught on to it, similar to #1634.

So I would say this is not truly a bug, but since per #444 not including the original file suffix in the file name could lead to problems, we should probably raise this upstream in Core, as I believe it should apply there too. Let's see if we can recreate the problem with Core alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken
Projects
Status: Not Started/Backlog 📆
Development

No branches or pull requests

2 participants