You may be looking for WP_Customize_Cropped_Image_Control
which has width
and height
parameters (along with flex_width
and flex_height
). This will then present you with the image dimensions when you select an image in the Customizer. For example, refer to how the Custom Logo control is registered in core:
$wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'custom_logo', array(
'label' => __( 'Logo' ),
'section' => 'title_tagline',
'priority' => 8,
'height' => $custom_logo_args[0]['height'],
'width' => $custom_logo_args[0]['width'],
'flex_height' => $custom_logo_args[0]['flex-height'],
'flex_width' => $custom_logo_args[0]['flex-width'],
'button_labels' => array(
'select' => __( 'Select logo' ),
'change' => __( 'Change logo' ),
'remove' => __( 'Remove' ),
'default' => __( 'Default' ),
'placeholder' => __( 'No logo selected' ),
'frame_title' => __( 'Select logo' ),
'frame_button' => __( 'Choose logo' ),
),
) ) );