Why Magic Bytes Override File Extensions
Operating systems and forensic parsers identify file formats using magic bytes at offset 0x00, not the file extension (.jpg, .png).
If the first 4 bytes are zeroed out (00 00 00 00), image renderers reject the file as corrupted even if all pixel data is 100% intact.
Inspecting secondary markers (like JFIF at offset 0x06 or IHDR at offset 0x0C) allows you to deduce the true format and restore the initial bytes.