[wp-trac] [WordPress Trac] #26823: wp_get_image_editor->multi_resize()

WordPress Trac noreply at wordpress.org
Mon Feb 10 12:03:43 UTC 2014


#26823: wp_get_image_editor->multi_resize()
--------------------------+------------------
 Reporter:  pbearne       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.9
Component:  Media         |     Version:  3.5
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------

Comment (by pbearne):

 Replying to [comment:39 DH-Shredder]:
 > This is still missing a test with both width and height set to null (and
 no image being generated as a result).
 >
 > As I may not get to this tonight, feel free to add one if you get to it
 first.  :)


 Will do

 I feel that we make sure that we don't have file with the expected value
 in the target folder so I feel we should add this before the function is
 run


 {{{
                 // loop the exected output and unlink and file found so we
 know
                 // this files are created by test
                 foreach( $resized as $key => $image_data ){
                         $image_path = DIR_TESTDATA . '/images/' .
 $image_data['file'];
                         @unlink( $image_path );
                 }
 }}}



 I see a couple of other values that could be used


 {{{
 //will create and image with the size in the filename
                         array(
                                 'width'  => 9999, # Arbitrary High Value
                                 'height' => 9999, # Arbitrary High Value
                         ),
 // will this crop the image to the max size
                         array(
                                 'width'  => 9999, # Arbitrary High Value
                                 'height' => 9999, # Arbitrary High Value
                                 'crop'   => true,
                         ),
 //will create and image with the size in the filename
                         array(
                                 'width'  => 0, # Arbitrary High Value
                                 'height' => 0, # Arbitrary High Value
                         ),
 // will this crop the image
                         array(
                                 'width'  => 0, # Arbitrary High Value
                                 'height' => 0, # Arbitrary High Value
                                 'crop'   => true,
                         ),
 }}}

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


More information about the wp-trac mailing list