[wp-trac] [WordPress Trac] #17626: image_get_intermediate_size() may return wrong thumbnail size

WordPress Trac noreply at wordpress.org
Wed Sep 24 10:01:11 UTC 2014


#17626: image_get_intermediate_size() may return wrong thumbnail size
----------------------------------------+-----------------------------
 Reporter:  chipbennett                 |       Owner:  markoheijnen
     Type:  defect (bug)                |      Status:  assigned
 Priority:  normal                      |   Milestone:  Future Release
Component:  Media                       |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+-----------------------------

Comment (by Krstarica):

 There is a special case when one of the image dimensions is zero.

 So:

 {{{
 if ( $data['width'] >= $size[0] || $data['height'] >= $size[1] ) {
 }}}

 should be replaced with:

 {{{
 if ( ($data['width'] >= $size[0] && $size[0] != 0) || ($data['height'] >=
 $size[1] && $size[1] != 0 ) ) {
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/17626#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list