How do I deactivate automatic image scaling in WordPress?

Images whose dimensions are larger than 2560 pixels are automatically scaled down by WordPress. This is generally a good solution, but in some cases it can also lead to problems if images have to remain large. The following code in functions.php prevents automatic image scaling.

add_filter( 'big_image_size_threshold', '__return_false' );