Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Someone Else 37

Forum Addict
Feb 10, 2013
1,876
1,440
168
57 I think some explanation is necessary.

A file extension is simply a reminder to your computer (and to yourself) as to what the contents of a particular file actually mean. A reminder; no more, no less. Other than that, it has absolutely no bearing on the way the data in the file is actually stored and compressed; or what programs will successfully be able to open it. If you rename the file and change the extension, all that may change is what your OS thinks is the proper program to use to open it. The actual contents of the file do not change.

It's also worth mentioning that Windoze uses solely the extension to determine what icon to display in the file manager and what program to open it with. Linux is smarter and looks at the file's metedata, so you can't confuse it by changing the extension.

For instance, say you download a gif off the Internet. It'll be saved on your hard drive as someimage.gif. If you then rename it someimage.doc, it won't suddenly turn into a Word document. Its icon may turn into the MS Word icon, and if you double-click it, it may pull up your preferred word processor... but it may or may not even manage to open the file, and if it does, it'll be full of gibberish. Because the file isn't actually a Word document- it's a pile of unrelated data that the word processor doesn't know what to do with. On Linux, you might have to open the word processor first, and then open the file through its interface- but if it does let you open it, you'll get the same effect.

Similarly, if you type up a document in a word processor and save it as somefile.png (or save it as somefile.doc and rename somefile.png), Gimp won't be able to open it- at least, not without producing a pile of gibberish.

With different image formats, it becomes a little trickier, since a program (like Gimp) that can deal with one format can usually deal with a lot of them. Furthermore, these programs are generally smart enough to look at the images' metadata instead of relying on the extension, so they'll be able to open images with the wrong extensions just fine. However, renaming an image still doesn't change anything about the nature of the image itself.

Say, one again, you download an animated gif off the Internet. You then rename it someimage.jpg, and then open it in GIMP. Gimp will treat the image just like it would treat a typical animated gif- with indexed colors, separate layers for each frame, no compression artifacts (other than those caused by the color indexing), etc. You can export it and GIMP will (in all likelihood- not tested) keep the same compression settings and whatnot, as well as the same filename. It's still a gif; just pretending to be a jpeg.

If, instead, you were to get an actual jpeg image from somewhere and rename it someimage.png, you can open it in GIMP, and GIMP will treat it like the jpeg that it is. You'll see all the usual artifacts of JPEG's lossy compression- unnecessary pixellation, random specks of the wrong colors near edges, maybe gridlike blocks of colors if the compression level is high enough. If you then edit the image in GIMP so that you no longer see those compression artifacts and export, you'll see the artifacts reappear, even though the png format uses lossless compression.

You can also see evidence for this same underlying thing by looking at file sizes. Changing the name (or extension) of a file won't change its size; but opening it in some program and exporting in a different format will.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
1 1 add 5 5 mull 3 3 add mull add
I know.
also, I kind of like how postscript works, if it indeed works the way I think it does.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
1 1 add 5 5 mull 3 3 add mull add
else you start to whimper once again? meh go ahead
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
1 1 add 5 5 mull 3 3 add mull add
oh, good job! you can do something else then whimpering :p
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
62 ask the makers of postscript, or at least the makers of that tutorial I used to see how to add and multiply with postscript.