3 ms·
Due to the PNG signature ("magic bytes"), every PNG file starts with the sequence "89 50 4E 47 0D 0A 1A 0A". In ASCII: "[\x89]PNG\r\n[SUB]\n" Is there any inf
by dbrgn 4y ago
Due to the PNG signature ("magic bytes"), every PNG file starts with the sequence "89 50 4E 47 0D 0A 1A 0A".
In ASCII: "[\x89]PNG\r\n[SUB]\n"
Is there any information on the origin of these bytes? Why were they chosen like that?
- blueflow 4y agoSo you'd get "PNG" printed out when you accidentally "type"ed that file in MS-DOS. The 1A was the EOF character for text data back then.
- edflsafoiewq 4y agoThey are explained in detail on the Wikipedia page: https://en.wikipedia.org/wiki/Portable_Network_Graphics#File_header https://en.wikipedia.org/wiki/Portable_Network_Graphics#File...