I want to resize an image keeping its original width unchanged. I only want to resize the height to 300px. I am trying following, but it changes the width automatically. How can I keep it unchanged?
$width = NULL; $height = 300; $image = wp_get_image_editor( $_FILES['u_img']['tmp_name'] ); $image -> resize( $width, $height, true );