Solved

figuring out extensions

Posted on 2014-03-20
8
229 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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
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 49

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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Simple Linear Regression

707 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