cloudinary / cloudinary_wordpress

Cloudinary's WordPress plugin
GNU General Public License v2.0
39 stars 28 forks source link

Responsive mode breakpoints are not the same for landscape and portrait images #936

Closed luveqz closed 3 months ago

luveqz commented 6 months ago

Bug Description

I have two images that have the same width, but one of them has a landscape aspect ratio, and the other a portrait one. No matter how I configure the min-max width option in the Responsive images tab, the portrait image's URL ends up with a different w_ transformation.

A practical implication is that portrait images are transformed to a quality that's below their best possible quality. This is specially visible when images contain text.

Am I missing something about how this plugin handles breakpoints?

Expected Behaviour

If image A and B have the same width, their w_ transformation should be the same as well.

Steps to reproduce

A simple PoC on TasteWP:

  1. Go to https://polishbody.s4-tastewp.com/wp-admin

  2. Login.

    • User: admin
    • Pass: O&*qDgt9qKL3O6DnVbB&rplL
  3. Create a post with these two images:

    • Image a (portrait).
    • Image b (landscape).
  4. If you open the inspector, you'll see that:

    • Images have a different w_ transformation.
    • Image A (portrait) is not rendered with its highest possible quality (w_720), regardless of how you configure your min-max width option in the Responsive images tab.

Screenshots

image image

Additional context

cloudinary-report-1708386355.json

luveqz commented 6 months ago

Sorry about the first version of this issue. It wasn't concise or clear enough. Hopefully it's better now.

dannyv-cloudinary commented 6 months ago

Hi @luveqz. I believe this is to be expected, as aspect ratio is taken into account when resizing, but I'd love to confirm your exact use-case. It seems the TasteWP environment is down/decommissioned. Would you be able to reactivate it so we can look at your config and test some things out?

Thanks, -Danny

luveqz commented 6 months ago

Hi, @dannyv-cloudinary. I couldn't replicate the issue but I did notice the plugin is now including a dpr_1.25 directive, which increases the quality of the image.

Did you implemented any change recently that could explain why this directive is now being added?

image

luveqz commented 6 months ago

Oh, and here is a minimal TasteWP instance you can use to verify the addition of that directive:

Admin URL: https://polishbody.s4-tastewp.com/wp-admin Username: luveqz Password: y-59xxh2ldY

dannyv-cloudinary commented 6 months ago

Thanks for providing that. Yes, the Wordpress plugin was updated recently - version v3.1.7 was released on Wednesday, February 21st: https://github.com/cloudinary/cloudinary_wordpress/releases/tag/3.1.7