WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#47713 new defect (bug)

image_get_intermediate_size does not return size if it equals original size

Reported by: mahnunchik Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.2.2
Component: Media Keywords: needs-patch
Focuses: Cc:
PR Number:

Description

Function image_get_intermediate_size does not return size if it equal original size.

  1. WordPress itself doesn't generate sizes metadata item for size equal original image size.
  2. image_get_intermediate_size looks throught sizes metadata and doesn't see necessary size.
  3. It doesn't check original image size.

More details here: https://github.com/Yoast/wordpress-seo/issues/10863

Attachments (2)

47713.diff (1.2 KB) - added by mahnunchik 3 months ago.
Select full size image if it is exact match to intermediate image fixes #47713 and #21714
47713.2.diff (1.4 KB) - added by mahnunchik 3 months ago.
correct patch

Download all attachments as: .zip

Change History (5)

@mahnunchik
3 months ago

Select full size image if it is exact match to intermediate image fixes #47713 and #21714

#2 @mahnunchik
3 months ago

I've fixed it! And another 7 years old ticket https://core.trac.wordpress.org/ticket/21714

#3 @mahnunchik
3 months ago

The correct version of patch attached.

@mahnunchik
3 months ago

correct patch

Note: See TracTickets for help on using tickets.