The most basic is going by the file name, as picture.jpg lets the computer know the binary data in the file is in jpeg format, so it should process that data as a jpeg and show you the results. But if you rename the jpeg to .txt and open it, you’ll just get a bunch of junk in your text viewing program as the binary image data is translated into text instead of a picture.
Apple computers also have forks, basically a tiny second file connected to the data file that has a bunch of information about the data.
After that, a computer can look into a file to see the pattern of the binary data in it and make a good guess as to what format it’s in. For example, a png file has a specific binary format that will have binary for the letters “PNG” near the beginning.
Latest Answers