Recently, been having a problem when I try to rename a picture or an icon, the following message appears: “If you change a file
name extension, the file may become unusable”. I have lost pictures when I went ahead and ignored the message. Why am I suddenly
having this problem?
I don’t know why you’re suddenly having the problem, but I do know what the problem is.
You actually haven’t lost your pictures – you’ve just removed the information that tells Windows what to do with them.
First, we need to understand how filenames are constructed. There are actually four parts to a full file path:
C: is the drive on which the file resides. (This can also be \\server\share for shared files located on a local area network)
/path/ is the path of folders and subfolders underneath which the file resides
basename is the base name of the file . This is probably what you think of as “the name”, in that it’s the part you choose to name or describe the file.
.ext is the extension. This is the part that tells Windows what kind of file it is.
The “filename” typically refers to the base name plus extension or basename.ext.
I’m going to assume you’re renaming your file using Windows Explorer, since that’s where it’s very easy to run into the problem you’re seeing.
Even though almost all files have the extensions, Windows Explorer does not display them by default. This is a huge mistake in my opinion, but it is what it is.
Here’s what I mean:
This is Windows Explorer in Thumbnail view on a folder of some pictures I have. Note how the filenames don’t show any extensions.
In Windows Explorer, click on the Tools menu, Folder Options menu item, and then the View tab:
Uncheck the “Hide extensions for known file types” option. Now we look at our files again:
As you can see, each filename’s extension is now visible: these are “.JPG” and “.NEF” files.
Now, I’m going to click on one of the images and press F2 to rename the file:
If I start to type a new filename, it overwrites the extension as well:
And sure enough, once I press Enter, I get this warning:
The problem? The “.jpg” is missing. Windows knows what a “_DSC5278.JPG” file is, it’s a jpeg image, or photo. But it has no idea what a “Horse” file is … the extension has been lost and Windows has no idea what to do with that file. It doesn’t even know how to show you a thumbnail:
Regardless of the path that you took to rename your file, that’s the problem – the filename’s extension is missing or incorrect.
The solution, of course, is to include or preserve the extension when you rename the file:
Simply by including the “.jpg” when I renamed the file, Windows understanding of what that file is has been preserved.
A couple of notes:
I strongly recommend not hiding extensions in Windows Explorer, as demonstrated above. Hiding extensions can actually allow malware to trick you into thinking they’re something that they’re not. For example, with extensions hidden “horse.jpg.exe” would display as “horse.jpg”. You might think it’s a picture, but it’s not – double clicking on it could launch a dangerous piece of malware.
In that same vein, be careful to know what it is your acting on – it’s not that uncommon to see pictures named “horse.jpg.jpg” because people didn’t realize extensions were hidden. It’s typically benign, but it can be confusing. Again, not hiding extensions solves this problem.
You’ll note that “.JPG” and “.jpg” were treated the same way. In general extensions are case insensitive – .jpg is the same as .JPG – in Windows (though they are typically case sensitive – .jpg is not the same as .JPG – when uploaded to web sites). Best to pick one approach and stick with it.
You cannot change a file’s type simply by renaming it. For example, you can not change a jpg file to a png file just by changing the extension to “.png”. It may be called a “.png”, but it’s still a jpeg file on the inside.