[wp-trac] [WordPress Trac] #42470: add_image_size: incorrect relative scaling

WordPress Trac noreply at wordpress.org
Wed Nov 8 16:53:02 UTC 2017


#42470: add_image_size: incorrect relative scaling
--------------------------+-----------------------------
 Reporter:  the_Alien_01  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  4.8.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Wordpress seems to mess up relative image scaling with add_image_size.

 The code of my child theme reads:
 {{{
 <?php
 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).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42470>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list