Make WordPress Core

Opened 5 weeks ago

#42470 new defect (bug)

add_image_size: incorrect relative scaling

Reported by: the_Alien_01 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.3
Component: Media Keywords:
Focuses: Cc:


Wordpress seems to mess up relative image scaling with add_image_size.

The code of my child theme reads:

add_image_size( 'name', 9999, 525, false );

With the '9999' based on https://developer.wordpress.org/reference/functions/add_image_size/#other-notes

Upon entering a landscape image w2500 x h1250 the image is resized to w525 x h263, taking the longest side of the image as height, instead of the actual height (in this case 1250px). Portrait images are (of course) resized according to their height (which is their longest side).

Change History (0)

Note: See TracTickets for help on using tickets.