I’d like to increase the size of the preview image on the media edit page. At the moment it’s too small to accurately crop.
../wp-admin/post.php?post=2758&action=edit&image-editor
1 Answer
Its not possible unless you modify the core.
File: wp-admin/includes/image-edit.php
line number 28 in wp_image_editor function
$sizer = $big > 400 ? 400 / $big : 1;
line number 346
function _image_get_preview_ratio($w, $h) {
$max = max($w, $h);
return $max > 400 ? (400 / $max) : 1;
}
This function is responsible for small image preview as you can see 400 / $max is fixed.
If you change 400 to 800 it works fine on my system.
Best possible way but partially working script.
It only change the size of the image but unable to update the parent image size so javascript not properly work here.
add_filter( 'image_editor_save_pre', 'custom_image_editor_save_pre', 10, 5 );
function custom_image_editor_save_pre( $image, $post_id ){
$temp = wp_get_image_editor( $post->guid );
if ( ! is_wp_error( $temp ) ) {
// calculate height in the ratio of width
$temp->resize( 800, 400, true );
}
return $temp;
}
Here is the ticket I raised for enhancement purpose.