wp-includes/SimplePie/src/Content/Type/Sniffer.php:182Sniff images
string public function image() { if (substr($this->file->body, 0, 6) === 'GIF87a' || substr($this->file->body, 0, 6) === 'GIF89a') { return 'image/gif'; } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { return 'image/png'; } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") { return 'image/jpeg'; } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") { return 'image/bmp'; } elseif (substr($this->file->body, 0, 4) === "\x00\x00\x01\x00") { return 'image/vnd.microsoft.icon'; } return false; }One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
string to string|false.verified against sourcesrc/wp-includes/SimplePie/src/Content/Type/Sniffer.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.