Computable Minds - www.computableminds.com
84

Differences between extension and format in a file

Posted on: Jun, 27th 2011
Today I'm going to dedicate the post to explain some basic concepts about the files that the 99% of the people that use a computer don't understand it very well.
Some users know that the last letters that there are at the end of a file (the extension), identifies the type of file, so, for instance, an archive ended in .JPG is a type of file of image and another ended in .GIF is a different image format with other characteristics. This, is true for most cases, but causes confusion in the cases where the extension isn't of a concrete format, unless of a format container.

But, what is a format container? Following with the example of the image files, the .TIF is a container of image formats. Inside a .TIF we can have the image without compression in raw format, or compressed in different ways, or even can be a JPG. In the same way, the files ended in .AVI, .MKV or .OGM, aren't formats by itself, are containers of video formats, for instance, a .AVI can contain a compressed video in the same format of a .MKV, which can be DivX, Xvid or any else. Surely that many have been in situations of this kind:

Luser: Can you convert this video?

User: To what format?

Luser: To AVI

User: ^^U AVI isn't a format

The difference between these containers is in the video formats and the sound that supports, the combinations that can do between them and if are proprietary or free. Also the extension .MPG can contain different formats although, in this case, all are normalized by the group MPEG (Moving Pictures Experts Group).

Also we have the users that think that simply renaming the file and changing the extension can change the format. Change the extension of the file don't serves to change its format. The extension serves to, in some cases, the program that open the file knows the algorithm that have to use to read it, and sometimes the program that opens even don't read the extension. For instance, we can rename a .GIF to .JPG and most of browsers will open it. This is because the browser doesn't look at the extension, look at the first bytes inside the file that identifies its format, find the identifier of the GIF and applies the algorithm to show GIF, although it has the extension .JPG. If by opposite we try to read the image, with a image viewer that reads the extension to apply an algorithm or another, will return an error trying to show the .GIF renamed to .JPG, because it will apply the algorithm to decompress the information in JPG, when really the information still is in .GIF.

The only way of change the format of the information inside of a file is using a program that transform it. Change the extension only serve to change the way of interpret the information, not to change the information itself. We can interpret the information of an image as if was music, music as if was an image or an image as it was the code of a program, but in most cases will get nothing more that an error or something unintelligible. However, we can do programs that can adapt to these situation to show in a coherent way, for instance, music as an animation, like some players do, or convert music in a web page, or hide secret messages inside of images or other kind of files, which is called steganography.

Comments (1): See comments Comment
Categories:

Share:

Copy and paste in your page:

Share
How about you!? Don't give your opinion?

Replying to the next comments:

To check if you are human answer the question correctly:

I don't like this question, change it!

None of these data will be stored.

(Write the e-mail)

Required field.

(Write the e-mail or several e-mails separated by coma)

Required field.

To check if you are human answer the question correctly:

I don't like this question, change it!

Comments
Manabjyoti
Date: Sep, 23rd 2012 Time: 5:13:52

Wow...

Thanx for the great info...

I really liked it

Daiatron on Google+