Just closing old topics, to clarify during the image import process we first check whether the domain of the image matches the current WordPress domain and switch to calling the file by filepath if possible, otherwise we default to using wp_remote_fopen() for fetching the image contents and passing the data stream onto wp_upload_bits which saves it to the WordPress Media as an Attachment.
There are checks built in during the image import process including:
– Checking the file exists at that filepath
– Checking the file exists at that URL
– Checking the image filesize is not empty
– Checking the image dimensions (if allow_url_fopen is enabled)
wp_remote_fopen first attempts to use the PHP function fopen() to download the file contents and then falls back to using cURL.