Solved

figuring out extensions

Posted on 2014-03-20
8
221 Views
Last Modified: 2014-03-25
make a text file
compress it
rename it to .jpg
compress it again
 rename it to .jpg

it is not a .jpg, but will allowed to say so.

why did windows allow this? is it just a way to anonymize a file, if need be?

when you rename a extension, does it corrupt the file by any chance?

if the extension is renamed, is there any tool to extract the original extension in which it was created?
0
Comment
Question by:25112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 144 total points
ID: 39942668
In general, extensions are just a convenience. They are functional in finding the correct application to open with file with if you double-click on one in Windows explorer. Changing the extension does not, by itself, change the file content.

It isn't clear why you would want to do such a series of actions
0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 144 total points
ID: 39942675
The format of many file types can be determined or guessed at by looking at the contents, but there is no systematic way of doing so. If successful the original extension can be inferred.
0
 
LVL 35

Assisted Solution

by:Dan Craciun
Dan Craciun earned 71 total points
ID: 39942684
You could rename a jpg to png and the browsers and Windows Photo Viewer will still display it without problems, so I guess they test if the file has the right extension, and decide upon the header, kind of like in Linux.

Try to load a jpg renamed in png in Photoshop though, and all you'll get is an error.

My point is that it's the application's choice to trust that the extension is correct or not.

HTH,
Dan
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Assisted Solution

by:Don Thomson
Don Thomson earned 71 total points
ID: 39942693
The only way to do it would be something like

Orig File   Text.txt
Compress it to Text.zip
Rename to Text.txt.jpg
Compress it to Text.txt.zip
rename it to Text.txt..zip.jpg
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 71 total points
ID: 39942703
The extension is pretty much just an indicator of what type of file it is and what program to use to open it with.
0
 
LVL 62

Assisted Solution

by:☠ MASQ ☠
☠ MASQ ☠ earned 71 total points
ID: 39942705
You can change a file extension to whatever you like, like changing the file name it has no effect on the content. However Windows has historically used file extensions to inform its Open With... command so most people will have an entry in their Windows registry that says if it ends with .jpg then treat it as a JPEG graphics format and open it with an appropriate program.  It's just a shorthand and makes the assumption that users will adopt a standard naming policy, as you describe it can be used to hide the true format of a file (sometimes maliciously).

The best way to get to the identify of a file is to look at the Hex signature in the file header though - if that's "FF D8 FF" then chances are whatever the file name and extension is it's probably a JPEG - some cleverer multimedia packages already look at the file header and will warn you if that and the file extension don't seem to be the same file type.

Although I said files aren't damaged simply by changing the file extension they can be harmed if they are then opened by the wrong program as a result.  Changing a .jpg extension to .txt and then opening and saving the file in a text editor rather than graphics program as a result might well convert the data from something like Unicode to ANSII rendering it useless if the file extension is changed back to its original setting.
0
 
LVL 48

Accepted Solution

by:
dbrunton earned 72 total points
ID: 39943226
>>  if the extension is renamed, is there any tool to extract the original extension in which it was created?

There are utils to determine what the file content is and thus the correct extension.

Examples:

Trid

Other Tools
0
 
LVL 5

Author Comment

by:25112
ID: 39954895
thanks- it helped me out
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question