[wp-trac] [WordPress Trac] #62507: WordPress 6.7.1 Auto-sizes Reducing Image Sizes
WordPress Trac
noreply at wordpress.org
Fri Nov 22 16:41:40 UTC 2024
#62507: WordPress 6.7.1 Auto-sizes Reducing Image Sizes
-------------------------------------------------+-------------------------
Reporter: thyran | Owner: joemcgill
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: Awaiting
| Review
Component: Media | Version: 6.7.1
Severity: normal | Resolution:
Keywords: needs-patch changes-requested close | Focuses:
| performance
-------------------------------------------------+-------------------------
Changes (by joemcgill):
* keywords: needs-patch => needs-patch changes-requested close
Comment:
Hi @thyran, thanks for the additional info. After reviewing both the live
site and the demo site you referenced, it looks like both are running
WordPress 6.7.1 with auto-sizes enabled and the stretching shown in
[https://snipboard.io/1YDz2n.jpg your original screenshot] no longer
seems to be occurring.
Let me know if you believe I've misunderstood how to observe the bug.
Further down the example URL you shared, the full width layout images do
seem to be distorted as a result of the auto-sizes functionality, but this
seems to be due to the image markup including incorrect width and height
attributes, authoring the image at 1080x675, while the intrinsic
dimensions of the src image is 500x375:
{{{
<img loading="lazy" decoding="async"
src="https://visionlab.online/divitest/wp-
content/uploads/2024/11/peter.jpg"
alt="Peter Edwards" class="" width="1080" height="675"
srcset="https://visionlab.online/divitest/wp-
content/uploads/2024/11/peter.jpg 1080w, https://visionlab.online/divitest
/wp-content/uploads/2024/11/peter-480x360.jpg 480w"
sizes="auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width:
481px) 1080px, 100vw">
}}}
I'm unsure what is causing this misconfiguration, but it doesn't seem to
be a workaround in the meantime would be to disable the auto-sizes feature
using the new filter added in WordPress 6.7.1:
{{{#!php
add_filter( 'wp_img_tag_add_auto_sizes', '__return_false' );
}}}
I would **strongly** suggest using this workaround instead of disabling
lazy loading in order to address this visual issue, as that will result in
site visitors loading more images than are necessary when a page is first
loaded.
Given that this does not seem to be a core issue, nor a reproducible bug,
I'm tentatively marking this ticket as a close candidate unless additional
information is available.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62507#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list