[wp-trac] [WordPress Trac] #25038: imagecreatetruecolor fails when WP tries to make image with width of 0

WordPress Trac noreply at wordpress.org
Thu Sep 12 00:31:43 UTC 2013


#25038: imagecreatetruecolor fails when WP tries to make image with width of 0
-------------------------------------+--------------------
 Reporter:  pat@…                    |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  3.7
Component:  Media                    |     Version:  trunk
 Severity:  major                    |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+--------------------
Changes (by plocha):

 * keywords:   => has-patch needs-testing
 * version:  3.6 => trunk


Comment:

 The problem is the scaling code. If you try to scale a 2x20 image with the
 ratio 0.25, you will get a 0.5x5 image. We use integers, so we get a 0x5
 image in this example. We should round up image sizes with 0px. I fixed an
 equivalent bug in the preview generation of the image editor.

 Maybe we should reorganize the code to avoid the redundant scaling code.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25038#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list