WordPress 5.3 Improves Large Image Handling

WordPress 5.3 Beta 3 was released this week and RC 1 is right around the corner, expected October 15. Core contributors have been publishing developer notes on new features landing in this release. One exciting enhancement that hasn’t received much attention yet is WordPress’ updated handling of large images.

Many WordPress users don’t consider the size of the images they are uploading to their sites, and modern smartphones are capable of producing very high quality images at very large file sizes. WordPress 5.3 will automatically detect large images (with a default threshold of 2560px) and generate a “web-optimized maximum size.” The threshold is used as the max-height and max-width value to scale down the image for use as the largest available size. A new big_image_size_threshold filter is available for developers who want to change the threshold size or disable the new feature altogether.

WordPress will store the original image size so that it is still accessible and a new function is available for fetching its path: wp_get_original_image_path(). It is also used to generate all the image sub-sizes.

More than two million WordPress users rely on plugins like Imsanity, Smushit, and EWWW Image Optimizer to optimize images. They often include additional features for bulk resizing previously uploaded images. WordPress’ new large image handling should not interfere with image optimization plugins, because it doesn’t affect the default settings that they often hook into and use to perform additional optimizations. The new core enhancement may be suitable to replace these plugins for some users who only require the bare minimum optimization on upload.