[wp-trac] [WordPress Trac] #24466: Custom image sizes display/insert with incorrect dimensions in media modal

WordPress Trac noreply at wordpress.org
Thu May 30 18:08:46 UTC 2013


#24466: Custom image sizes display/insert with incorrect dimensions in media modal
--------------------------+-----------------------------
 Reporter:  ericlewis     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  trunk
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Something seems wonky in the backbone interface for media modals with a
 custom image size defined with hard cropping mode.

 Drop this boilerplate in a plugin or theme. I dropped it into
 functions.php of Twenty Thirteen.

 {{{
 add_action( 'after_setup_theme', 'add_a_custom_image_size' );

 function add_a_custom_image_size() {
         add_image_size( 'fat-and-short', 900, 300, true );
 }

 add_filter( 'image_size_names_choose',
 'add_a_custom_image_size_to_media_modal', 10, 1 );

 function add_a_custom_image_size_to_media_modal( $sizes ) {
         $sizes['fat-and-short'] = 'Fat and Short';
         return $sizes;
 }
 }}}

 Then upload [http://www.theleek.com/wp-content/uploads/2013/04/bill-
 murray-wallpaper-2-711697.jpg an image larger than these constraints] in
 an Edit Post media modal. In the dropdown for attachment size, I see "Fat
 and Short - 604 x 201" - not the size defined. Even more bizarre, when the
 img element is inserted, it refers to the right file for the size
 (...-900x300.jpg), but the attributes on the image are set to the wonky
 dimensions.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24466>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list