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

WordPress Trac noreply at wordpress.org
Thu May 22 17:05:13 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:
----------------------------------------+-----------------------------
Changes (by ericlewis):

 * keywords:  has-patch needs-testing => has-patch needs-unit-tests


Comment:

 I've simplified the logic in attachment:17626.diff.

 In the first loop, if there's an exact match, short circuit. Otherwise,
 store any image sizes that are larger than the one requested in a hash.
 Loop back through this hash (sorted by area size), and return the first
 one.

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


More information about the wp-trac mailing list