Large image not showing dimensions in Media Library

I see this happen when WP runs out of memory or time while processing large images. The image resizing, including setting the attachment custom fields for the dimensions, doesn’t complete. It can be the image dimensions (uncompressed file size really) rather than jpeg file size that are the problem, as the image is decompressed into memory for WP to work on it.

You can try increasing the time that PHP processes can run, if your hosting allows that.

WP has filter hooks just for dealing with this issue and this snippet in my theme’s functions.php worked for me when I was testing this out.

add_filter( 'admin_memory_limit', 'wh_admin_memory_limit' );
add_filter( 'image_memory_limit', 'wh_admin_memory_limit' );

function wh_admin_memory_limit( $limit ) {
    set_time_limit(60);
    return '1024M';

}

Setting the longer time limit in this way means you aren’t increasing it site wide, so you keep the protection it gives you against runaway processes.

Might be time to get better hosting!