If we open a PNG file in Windows Notepad and change it, the file becomes unusable. Why can’t we reverse the damage by changing the text back to its original state?

91 viewsOtherTechnology

If we open a PNG file in Windows Notepad and change it, the file becomes unusable. Why can’t we reverse the damage by changing the text back to its original state?

In: Technology

2 Answers

Anonymous 0 Comments

Because Notepad is dumb. It is made to understand text files, and those don’t allow all byte combinations. When asked to save something it doesn’t understand, it may apply text formatting conventions, such as always following a carriage return command with a line feed command. In a PNG file, those same bytes mean different things, and now they’ve been scrambled. If you want to poke at any file without having it changed unexpectedly, use a hex editor. It’s made specifically for that purpose and doesn’t try to translate it into something it’s not.

You are viewing 1 out of 2 answers, click here to view all answers.