Debugging upload problem: What part of WP does actual image-resizing?

You can add a filter to wp_image_editors and see what editor is in use (GD or Imagick). In a past project I’ve extended the resize routines on both GD, and Imagick, and the methods responsible for resize are WP_Image_Editor_Imagick->crop() and WP_Image_Editor_GD->_resize().

Note that WP_Image_Editor_GD->resize() is just a wrapper.

The process it’s run on ajax, but you can use var_dump() to debug it – it will show up on uploaded image messages, the box with progress bar and all.

add_filter( 'wp_image_editors', 'wp23092013_extend_image_editor' );

function wp23092013_extend_image_editor( $editor ) {
    var_dump( $editor );
    return $editor;
}

Happy debugging 😉

Leave a Comment